forked from jeryqwq/ProApplication
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.prod.ts
59 lines (57 loc) · 1.45 KB
/
config.prod.ts
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
import { defineConfig } from '@umijs/max';
console.log('config.prod is working 😊');
// 注: dev模式下的externals配置后增加相关development.js在开启mfsu的前提下优化效果可能不是很大,所以没做
// const moduleFederationName = '__vis';
// const shared = { // 使用mf共享模块
// react: {
// singleton: true,
// eager: true,
// },
// 'react-dom': {
// singleton: true,
// eager: true,
// },
// 'antd': {
// singleton: true,
// eager: true,
// }
// }
export default defineConfig({
// deadCode: {
// failOnHint: true, // will force a error message and exit immediately
// exclude some folder or directory
// exclude: ['pages/unused/**'],
// },
// mf: {
// name: moduleFederationName,
// library: { type: "window", name: "__vis" },
// shared
// },
// mfsu: {
// // strategy: 'eager',
// mfName:`mf_${moduleFederationName}`,
// remoteName: moduleFederationName,
// shared
// },
publicPath: '/main/',
mfsu: {
esbuild: true,
},
jsMinifier: 'esbuild',
jsMinifierOptions: {
minifyWhitespace: true,
minifyIdentifiers: true,
minifySyntax: true,
drop: ['console'],
},
cssMinifierOptions: {
minifyWhitespace: true,
minifySyntax: true,
},
codeSplitting: {
// granularChunks as testing in lighthouse it get 1% better performance
jsStrategy: 'granularChunks',
jsStrategyOptions: {},
cssStrategyOptions: {},
},
});