-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
43 lines (42 loc) · 1.17 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
import { defineConfig, loadEnv } from "vite"
import react from "@vitejs/plugin-react"
import path from "path"
export default defineConfig(({ mode }) => {
return {
base: "",
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"@public": path.resolve(__dirname, "./public"),
components: path.resolve(__dirname, "src/components"),
utils: path.resolve(__dirname, "src/utils"),
},
},
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: "globalThis",
},
},
},
//server配置
server: {
// hmr:true,
port: 8000,
host: "0.0.0.0",
open: true,
// 代理设置
proxy: {
// '/!/trading-desk/upm/login': {
// target: 'http://uat-al.cdp.changan.com.cn/', //测试服务
// // target: 'https://www.cdp.changan.com.cn/', //测试服务
// ws: true, // websockets
// changeOrigin: true, //将主机头的原始信息更改为目标 URL,
// rewrite: (path) => path.replace('/!/trading-desk', '/'),
// },
},
},
}
})