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.
myAmis/vite.config.js

33 lines
860 B

1 year ago
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
1 year ago
import {
fileURLToPath,
URL
} from 'node:url'
1 year ago
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
1 year ago
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/, "")
},
}
},
1 year ago
})