-
Notifications
You must be signed in to change notification settings - Fork 0
/
craco.config.js
executable file
·41 lines (40 loc) · 993 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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: 8001, // B 端,前端
host: '0.0.0.0',
// proxy: {
// '/api': 'http://localhost:3005', // Mock
// },
},
}