There are a few answers that provide solutions with react-app-rewired
, but customize-cra
exposes a special removeModuleScopePlugin()
API which is a bit more elegant. (It's the same solution, but abstracted away by the customize-cra
package.)
npm i --save-dev react-app-rewired customize-cra
"scripts": {
- "start": "react-scripts start"
+ "start": "react-app-rewired start",
...
},
const { removeModuleScopePlugin } = require('customize-cra')
module.exports = removeModuleScopePlugin()