-
Notifications
You must be signed in to change notification settings - Fork 2
/
.umirc.js
50 lines (48 loc) · 1.15 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
import routes from "./src/pages/routes";
import config from './config';
import path from 'path';
console.log('Development...')
export default {
// 环境变量
context: {
title: 'UMI+DVA详解',
},
define: {
"process.env.ENV": process.env.UMI_ENV === 'prod' ? 'production' : 'development',
},
alias: {
'@assets': path.resolve(__dirname, './src/assets'),
'@config': path.resolve(__dirname, './config'),
'@lib': path.resolve(__dirname, './src/pages/lib'),
'@layouts': path.resolve(__dirname, './src/layouts'),
'@service': path.resolve(__dirname, './src/service'),
},
base: '',
routes: routes,
history: 'hash',
cssModulesExcludes: config.cssExclude,
lessLoaderOptions: {
test: /\.less$/,
loader: 'less-loader', // compiles Less to CSS
},
treeShaking: true,
plugins: [
// ref: https://umijs.org/plugin/umi-plugin-react.html
['umi-plugin-react', {
antd: false,
dva: {
immer: true
},
dynamicImport: {
webpackChunkName: true,
},
title: '',
dll: false,
routes: {
exclude: [
/components\//,
],
},
}],
],
}