-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
59 lines (58 loc) · 1.31 KB
/
vite.config.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 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'node:path'
import Components from 'unplugin-vue-components/vite';
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
import { base } from "./src/settings";
// https://vitejs.dev/config/
export default defineConfig({
base,
resolve: {
alias: [
{ find: '@', replacement: resolve(__dirname, 'src') }
]
},
html: {
cspNonce: '123'
},
assetsInclude: [
'**/*.gltf'
],
build: {
rollupOptions: {
// https://rollupjs.org/guide/en/#outputmanualchunks
output: {
manualChunks: {
// todo 手动分块
// https://router.vuejs.org/zh/guide/advanced/lazy-loading.html#%E4%BD%BF%E7%94%A8-Vite
}
}
}
},
server: {
// host: ''
proxy: {
'/dev': {
target: 'http://172.0.0.2:8090',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/dev/, '')
},
'/socket.io': {
target: 'ws://localhost:8088',
ws: true,
rewriteWsOrigin: true
}
}
},
plugins: [
vue(),
Components({
resolvers: [
AntDesignVueResolver({
// Disables automatic CSS imports, using CSS-in-JS
importStyle: false
})
]
})
],
})