From 68b6cd185563069c594a1b50554a58d2aa1c1feb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 22 Sep 2023 18:48:32 +0000 Subject: [PATCH] Update optimizer webpack config to support ReactFlow dependency (#4882) * Add reactflow with compiler fix Signed-off-by: Tyler Ohlsen * Update CHANGELOG Signed-off-by: Tyler Ohlsen * Update comment Signed-off-by: Tyler Ohlsen * Revert adding reactflow dep Signed-off-by: Tyler Ohlsen --------- Signed-off-by: Tyler Ohlsen Co-authored-by: Miki (cherry picked from commit eec3ed789fa160d5cb68cb32c8c41f4c5fbde1a7) Signed-off-by: github-actions[bot] --- .../osd-optimizer/src/worker/webpack.config.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/osd-optimizer/src/worker/webpack.config.ts b/packages/osd-optimizer/src/worker/webpack.config.ts index 6adfc1d6d90a..cfe79b4b19a1 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: {