-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
59 lines (57 loc) · 1.42 KB
/
vite.config.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
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
// 强制预构建插件包
optimizeDeps: {
include: [
`monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution`,
`monaco-editor/esm/vs/language/json/json.worker`,
`monaco-editor/esm/vs/language/css/css.worker`,
`monaco-editor/esm/vs/language/html/html.worker`,
`monaco-editor/esm/vs/language/typescript/ts.worker`,
`monaco-editor/esm/vs/editor/editor.worker`
],
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
proxy: {
'/mcenter/api/v1': {
target: 'http://127.0.0.1:8010'
},
'/mflow/api/v1/ws': {
target: 'http://127.0.0.1:8090',
ws: true,
},
'/mflow/api/v1': {
target: 'http://127.0.0.1:8090'
},
'/mpaas/api/v1/ws': {
target: 'http://127.0.0.1:8080',
ws: true,
},
'/mpaas/api/v1': {
target: 'http://127.0.0.1:8080'
}
}
},
build: {
rollupOptions: {
output:{
manualChunks(id) {
if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString();
}
}
}
}
}
})