-
Notifications
You must be signed in to change notification settings - Fork 0
/
craco.config.cjs
39 lines (38 loc) · 886 Bytes
/
craco.config.cjs
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
35
36
37
38
39
module.exports = {
webpack: {
configure(webpackConfig) {
if (webpackConfig.mode === 'production') {
if (webpackConfig.optimization == null) {
webpackConfig.optimization = {}
}
webpackConfig.optimization.splitChunks = {
chunks: 'all',
cacheGroups: {
antd: {
name: 'antd-chunk',
test: /antd/,
priority: 100,
},
reactDom: {
name: 'reactDom-chunk',
test: /react-dom/,
priority: 99,
},
vendors: {
name: 'vendors-chunk',
test: 'node_modules',
priority: 98,
},
},
}
}
return webpackConfig
},
},
devServer: {
port: 8000,
proxy: {
'/api': 'http://localhost:3001',
},
},
}