-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcraco.config.js
34 lines (33 loc) · 1.3 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
32
33
34
const { when, whenDev, whenProd, whenTest, ESLINT_MODES, POSTCSS_MODES } = require("@craco/craco");
// https://github.com/DocSpring/craco-antd
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const WebpackBar = require("webpackbar");
const CracoAntDesignPlugin = require("craco-antd");
const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin');
const path = require("path");
module.exports = {
reactScriptsVersion: "react-scripts" /* (default value) */,
eslint: {
enable: true /* (default value) */,
mode: "extends" /* (default value) */ || "file",
configure: { /* Any eslint configuration options: https://eslint.org/docs/user-guide/configuring */ },
},
webpack: {
plugins: [
new WebpackBar({ profile: true }),
...(process.env.NODE_ENV === "development"
? [new BundleAnalyzerPlugin({ openAnalyzer: false })]
: []),
// https://ant.design/docs/react/use-with-create-react-app
// new AntdDayjsWebpackPlugin() enable it later using momentjs
]
},
plugins: [
{
plugin: CracoAntDesignPlugin,
options: {
customizeThemeLessPath: path.resolve(__dirname,'./src/style/AntDesign/customTheme.less')
}
}
]
};