diff --git a/packages/osd-optimizer/src/worker/webpack.config.ts b/packages/osd-optimizer/src/worker/webpack.config.ts index 5a0f1cc36728..a66ad06de032 100644 --- a/packages/osd-optimizer/src/worker/webpack.config.ts +++ b/packages/osd-optimizer/src/worker/webpack.config.ts @@ -235,6 +235,21 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: }, }, }, + { + test: /\.js$/, + /* reactflow and some of its dependencies don't have es5 builds + * so we need to build from source and transpile for webpack v4 + */ + include: /node_modules[\\/]@?reactflow/, + use: { + loader: 'babel-loader', + options: { + babelrc: false, + envName: worker.dist ? 'production' : 'development', + presets: [BABEL_PRESET_PATH], + }, + }, + }, { test: /\.(html|md|txt|tmpl)$/, use: {