Skip to content

Commit

Permalink
Update optimizer webpack config to support ReactFlow dependency (#4882)…
Browse files Browse the repository at this point in the history
… (#5094)

* Add reactflow with compiler fix



* Update CHANGELOG



* Update comment



* Revert adding reactflow dep



---------



(cherry picked from commit eec3ed7)

Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Miki <miki@amazon.com>
  • Loading branch information
3 people authored Sep 23, 2023
1 parent 2eea156 commit 42db9b5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/osd-optimizer/src/worker/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 42db9b5

Please sign in to comment.