-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
48 lines (48 loc) · 1.03 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
import { defineConfig } from 'vite'
import { fileURLToPath, URL } from 'node:url'
import react from '@vitejs/plugin-react-swc'
import svgr from "vite-plugin-svgr";
import legacy from '@vitejs/plugin-legacy'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
legacy(),
react(),
svgr()
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
build: {
rollupOptions: {
output: {
manualChunks: {
antd: ['antd'],
react: ['react', 'react-dom', 'react-router-dom', 'react-i18next', 'zustand', 'ahooks'],
lodash: ['lodash'],
}
},
}
},
server: {
open: true,
proxy: {
//配置跨域
'/api': {
target: 'http://127.0.0.1:11419/',
changeOrigin: true
},
'/rec_file': {
target: 'http://127.0.0.1:11419/',
changeOrigin: true
},
'/ws': {
target: 'ws://127.0.0.1:11419/',
changeOrigin: true,
ws: true
}
}
},
})