forked from AyazKhuraishi/ReactFO-ServiceFlow-front
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcraco.config.js
22 lines (18 loc) · 884 Bytes
/
craco.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// this workaround fix a warning of mini-css-extract-plugin throws "Conflicting order" during build
// https://github.com/facebook/create-react-app/issues/5372
const path = require("path")
module.exports = {
webpack: {
configure: (webpackConfig) => {
const instanceOfMiniCssExtractPlugin = webpackConfig.plugins.find(
(plugin) => plugin.options && plugin.options.ignoreOrder != null,
);
if (instanceOfMiniCssExtractPlugin)
instanceOfMiniCssExtractPlugin.options.ignoreOrder = true;
webpackConfig.resolve.alias['react'] = path.resolve(__dirname, 'node_modules/react'); // solve 2 react instances
webpackConfig.resolve.alias['@emotion/react'] = path.resolve("node_modules", "@emotion/react");
webpackConfig.resolve.alias['@mui/styles'] = path.resolve("node_modules", "@mui/styles");
return webpackConfig;
}
}
}