Open Drarig29 opened 3 years ago
What I did to resolve the issue, but only temporarily, is to add webpack-modules
in node_modules/cra-preact/src/(start|build).js
.
Like the following:
const hookIntoRequire = require('require-in-the-middle')
+ const WebpackModules = require('webpack-modules')
hookIntoRequire(['react-scripts/config/webpack.config'], configFactory => {
const config = configFactory('production')
config.resolve.alias['react'] = 'preact/compat'
config.resolve.alias['react-dom'] = 'preact/compat'
config.resolve.alias['react-dom/test-utils'] = 'preact/test-utils'
+ config.plugins.push(new WebpackModules())
return () => config
})
require('react-scripts/scripts/build')
Describe the bug
I have this error when I
yarn start
andyarn build
.This is linked to this comment: https://github.com/preactjs/preact/issues/1399#issuecomment-472561720
To Reproduce Steps to reproduce the behavior:
Expected behavior It should build the project.
Versions