You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
import {
|
|
|
|
fileURLToPath,
|
|
|
|
URL
|
|
|
|
} from 'node:url'
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
|
|
|
plugins: [react()],
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'@': fileURLToPath(new URL('./src',
|
|
|
|
import.meta.url))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
server: {
|
|
|
|
host: "0.0.0.0",
|
|
|
|
proxy: {
|
|
|
|
'/api': {
|
|
|
|
// target: "http://10.10.10.107:9208",// 目标地址
|
|
|
|
target: `http://10.10.10.168:8080`,// sar目标地址
|
|
|
|
// target: `http://10.10.10.200/api/`,// 测试服务器址
|
|
|
|
// target: "http://10.10.10.146:9309",// Rock目标地址
|
|
|
|
// target: `http://togy.top:18080/api/`,// sar目标地址
|
|
|
|
ws: true,// 开始ws代理
|
|
|
|
changeOrigin: true, // 开发模式
|
|
|
|
rewrite: (path) => path.replace(/^\/api/, "")
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
})
|