Skip to content

Commit bbda33e

Browse files
committed
fix(webpack): alias react-checkbox-tree to ESM entry for v2 compatibility
1 parent 86a8b16 commit bbda33e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

web/webpack.shim.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ let webpackShimConfig = {
4444
'graphlib': path.join(__dirname, 'node_modules/graphlib'),
4545
'react': path.join(__dirname, 'node_modules/react'),
4646
'react-dom': path.join(__dirname, 'node_modules/react-dom'),
47+
48+
// v2 added "type":"module" to package.json, causing webpack to treat lib/index.js
49+
// as ESM (even though it's a UMD bundle) and ignore its module.exports assignment. Force the true
50+
// ESM entry instead so webpack reads the proper export statements.
51+
'react-checkbox-tree': path.join(__dirname, 'node_modules/react-checkbox-tree/lib/index.esm.js'),
4752
'stylis': path.join(__dirname, 'node_modules/stylis'),
4853
'popper.js': path.join(__dirname, 'node_modules/popper.js'),
4954

0 commit comments

Comments
 (0)