My understanding is react-app-rewired no longer works in v2 of create-react-app.
It seems you need to get into babel (thus react-app-rewired).
My understanding is react-app-rewired no longer works in v2 of create-react-app.
It seems you need to get into babel (thus react-app-rewired).
You can use craco instead of react-app-rewired.
Information from react-app-rewired issue comments:
Here are some example craco.config.js configuration files:
Less
Ant Design + Less + modifyVars
Ant Design + Less + modifyVars + Preact
PreactThere are some more examples in the /recipes directory in the craco repo.
Example of craco.config.js from ndbroadbent:
const CracoAntDesignPlugin = require('craco-antd');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const WebpackBar = require('webpackbar');
module.exports = {
webpack: {
alias: { react: 'preact-compat', 'react-dom': 'preact-compat' },
plugins: [
new BundleAnalyzerPlugin(),
new WebpackBar({ profile: true }),
],
},
plugins: [{ plugin: CracoAntDesignPlugin }],
};