This repository has been archived by the owner on Dec 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.umirc.js
63 lines (57 loc) · 1.54 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
const pkg = require('./package.json');
// const version = `${pkg.version.split('.')[0]}.x`;
const serverRootDirect = process.env.NODE_ENV === 'production' ? 'https://doly-dev.github.io/doly-admin-components/' : '/';
const logo = 'https://www.caijinfeng.com/assets/images/[email protected]';
const favicon = 'https://www.caijinfeng.com/assets/images/doly-touch-icon_48x48.png';
// const outputPath = 'site/' + version;
const outputPath = 'site';
const publicPath = serverRootDirect + outputPath + '/';
const manifestLink = `${publicPath}asset-manifest.json`;
const links = process.env.NODE_ENV === 'production' ? [{ rel: 'manifest', href: manifestLink }] : [];
const umiConfig = {
extraBabelPlugins: [[
'babel-plugin-import',
{
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
},
]],
mode: 'doc',
history: {
type: 'hash'
},
title: pkg.name,
logo,
favicon,
publicPath,
outputPath,
manifest: {
publicPath
},
links,
hash: true,
locales: [['zh-CN', '中文'], ['en-US', 'English']]
};
if (process.env.NODE_ENV === 'production') {
umiConfig.chunks = ['vendors', 'umi'];
umiConfig.chainWebpack = function (config, { webpack }) {
config.merge({
optimization: {
minimize: true,
splitChunks: {
cacheGroups: {
vendor: {
test: /node_modules/,
chunks: "all",
name: "vendors",
priority: -10,
enforce: true
}
}
}
}
});
}
}
export default umiConfig;