Skip to content

Commit

Permalink
fix webpack modules shilangyu#7
Browse files Browse the repository at this point in the history
  • Loading branch information
Drarig29 committed Aug 18, 2021
1 parent cb8d68b commit ae96e87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
},
"dependencies": {
"preact": "^10.3.2",
"require-in-the-middle": "^5.0.3"
"require-in-the-middle": "^5.0.3",
"webpack-modules": "^1.0.0"
}
}
3 changes: 3 additions & 0 deletions src/build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const hookIntoRequire = require('require-in-the-middle')
const WebpackModules = require('webpack-modules')

hookIntoRequire(['react-scripts/config/webpack.config'], configFactory => {
const config = configFactory('production')
Expand All @@ -7,6 +8,8 @@ hookIntoRequire(['react-scripts/config/webpack.config'], configFactory => {
config.resolve.alias['react-dom'] = 'preact/compat'
config.resolve.alias['react-dom/test-utils'] = 'preact/test-utils'

config.plugins.push(new WebpackModules())

return () => config
})

Expand Down

0 comments on commit ae96e87

Please sign in to comment.