-
Notifications
You must be signed in to change notification settings - Fork 4
/
craco.config.js
31 lines (30 loc) · 1.03 KB
/
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
23
24
25
26
27
28
29
30
31
// eslint-disable-next-line @typescript-eslint/no-var-requires
const CracoAntDesignPlugin = require("craco-antd");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
webpack: {
configure: (webpackConfig, { env, paths }) => {
webpackConfig = {
...webpackConfig,
plugins: [
...webpackConfig.plugins.filter((element) => {
if (element.options) {
// eslint-disable-next-line no-prototype-builtins
return !element.options.hasOwnProperty("ignoreOrder");
}
return true;
}),
new MiniCssExtractPlugin({
filename: "static/css/[name].[contenthash:8].css",
moduleFilename: this.moduleFilename,
ignoreOrder: true,
chunkFilename: "static/css/[name].[contenthash:8].chunk.css",
}),
],
};
return webpackConfig;
},
},
plugins: [{ plugin: CracoAntDesignPlugin }],
};