forked from jeryqwq/ProApplication
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.umirc.ts
85 lines (80 loc) · 2.07 KB
/
.umirc.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { defineConfig } from '@umijs/max';
const genAlias = require('./scripts/utils/genAlias')
import routes from './src/routes'
const isDev = process.env.NODE_ENV === 'development'
// 注: 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({
externals: isDev ? {} : { react: 'React', 'react-dom/client': 'ReactDOM', 'lodash': '_', 'moment': 'moment' },
headScripts: isDev ? [] : ['/main/cdn/react.production.min.js', '/main/cdn/react-dom.production.min.js', '/main/cdn/lodash.min.js', '/main/cdn/moment.min.js'],
ignoreMomentLocale: true,
fastRefresh: true,
// mf: {
// name: moduleFederationName,
// library: { type: "window", name: "__vis" },
// shared
// },
// mfsu: {
// // strategy: 'eager',
// mfName:`mf_${moduleFederationName}`,
// remoteName: moduleFederationName,
// shared
// },
antd: {
},
hash: true,
history: {
type: 'hash'
},
clickToComponent: {},
access: {},
model: {},
initialState: {},
alias: {
...genAlias()
},
// monorepoRedirect: {
// srcDir: ['src'],
// },
request: {},
routes,
npmClient: 'pnpm',
qiankun: {
master: {
apps: [
{
name: 'dash',
entry: isDev ? 'http://127.0.0.1:7777' : 'http://10.28.184.132:8088/dash/',
},
{
name: 'dataModel',
entry: isDev ? 'http://127.0.0.1:7780' : 'http://10.28.184.132:8088/dataModel/',
},
{
name: 'visual',
entry: isDev ? 'http://127.0.0.1:7778' : 'http://10.28.184.132:8088/visual/',
}
],
},
},
publicPath: isDev ? '/' : '/main/',
proxy: {
"/vis": {
"target": "http://10.28.184.132:8089/"
}
}
});