-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.umirc.js
57 lines (57 loc) · 1.16 KB
/
.umirc.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// ref: https://umijs.org/config/
export default {
treeShaking: true,
history: 'hash',
externals: {
// bizcharts: 'BizCharts'
},
extraBabelPlugins: [
// ['import', { libraryName: 'recharts', libraryDirectory: 'lib/component' }]
],
plugins: [
// ref: https://umijs.org/plugin/umi-plugin-react.html
[
'umi-plugin-react',
{
antd: true,
dva: true,
dynamicImport: { webpackChunkName: true },
title: 'test',
dll: false,
routes: {
exclude: [ /models\//, /services\//, /model\.(t|j)sx?$/, /service\.(t|j)sx?$/, /components\// ]
}
}
]
],
chainWebpack(config, { webpack }) {
config.optimization.splitChunks({
cacheGroups: {
// styles: {
// chunks: "all",
// name: "styles",
// test: /(css|less)/,
// priority: 1,
// minSize: 0,
// minChunks: 1
// },
recharts: {
chunks: "all",
name: "recharts",
test: /(recharts|recharts-scale)/,
enforce: true,
priority: 10,
minSize: 0,
minChunks: 1
},
vendor: {
chunks: "all",
name: "vendor",
priority: 1,
minSize: 0,
minChunks: 1
}
}
});
}
};