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
* Add reactflow with compiler fix

Signed-off-by: Tyler Ohlsen <[email protected]>

* Update CHANGELOG

Signed-off-by: Tyler Ohlsen <[email protected]>

* Update comment

Signed-off-by: Tyler Ohlsen <[email protected]>

* Revert adding reactflow dep

Signed-off-by: Tyler Ohlsen <[email protected]>

---------

Signed-off-by: Tyler Ohlsen <[email protected]>
Co-authored-by: Miki <[email protected]>
(cherry picked from commit eec3ed7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and AMoo-Miki committed Sep 22, 2023
1 parent d8dc7f8 commit 68b6cd1
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 68b6cd1

Please sign in to comment.