-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.umirc.js
77 lines (75 loc) · 1.8 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import {
resolve
} from 'path';
export default {
hash: true, // 打包时文件是否带hash值
targets: {
ie: 9,
},
plugins: [
['umi-plugin-react', {
// antd: true,
routes: {
exclude: [/contexts\//, /services\//, /components\//, /typings\//, /utils\//, /interfaces\//],
},
locale: {
default: 'zh-CN',
// antd: true,
},
dynamicImport: {
webpackChunkName: true,
loadingComponent: './components/Loading',
},
title: {
defaultTitle: 'umi-ts-template',
},
chunks: ['config', 'umi'],
}],
],
alias: {
src: resolve(__dirname, './src'),
},
// 配置less变量
theme: {
// "@primary-color": "#1DA57A",
},
// theme: "./theme-config.js",
// 单纯做复制的文件列表
// copy: [
// {
// from: 'path/to/file.txt',
// to: 'file/without/extension',
// },
// ],
chainWebpack(config, {
webpack
}) {
// config.merge({
// plugin: {
// install: {
// plugin: require('uglifyjs-webpack-plugin'),
// args: [{
// sourceMap: false,
// uglifyOptions: {
// compress: {
// // 删除所有的 `console` 语句
// drop_console: true,
// },
// output: {
// // 最紧凑的输出
// beautify: false,
// // 删除所有的注释
// comments: false,
// },
// },
// }],
// },
// },
// });
config
.entry('config').add('src/config.ts').end()
.output.filename((chunkData) => {
return chunkData.chunk.name === 'config' ? '[name].js': '[name].[hash].chunk.js';
}).path(__dirname + '/dist').end();
},
};