forked from brick-design/brick-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.umirc.ts
More file actions
52 lines (49 loc) · 1.16 KB
/
Copy path.umirc.ts
File metadata and controls
52 lines (49 loc) · 1.16 KB
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
const path=require('path')
import { IConfig } from 'umi-types';
const config:IConfig={
chainWebpack(config, { webpack }) {
// 设置 alias
config.resolve.alias.set('@', path.resolve(__dirname, 'src'));
config.optimization.splitChunks({
chunks: 'async',
minSize: 30000,
maxSize: 0,
minChunks: 1,
maxAsyncRequests: 6,
maxInitialRequests: 4,
automaticNameDelimiter: '~',
name: true,
cacheGroups: {
vendors: {
name: 'vendors',
chunks: 'all',
test: /[\\/]node_modules[\\/](react|react-dom|lodash|dva|prop-types|rc-animate|re-resizable|sortablejs|highlight.js)[\\/]/,
priority: -10,
},
antdesigns: {
name: 'antdesigns',
chunks: 'all',
test: /[\\/]node_modules[\\/](@ant-design|antd)[\\/]/,
priority: -11,
}
},
});
},
publicPath:'./',
plugins: [
[
'umi-plugin-block-dev',
{},
],
[
'umi-plugin-react',
{
dva: true,
antd: true,
locale: true,
chunks: ['vendors','antdesigns', 'umi']
},
],
]
}
export default config;