GPU_Web/vite.config.ts
2026-01-06 14:20:31 +08:00

31 lines
757 B
TypeScript

// vite.config.js
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { fileURLToPath, URL } from "node:url";
import path from "path";
export default defineConfig({
plugins: [vue()],
// resolve: {
// alias: {
// '@': fileURLToPath(new URL('./src', import.meta.url))
// }
// },
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
server: {
port: 8080, // 设置开发服务器端口为 8080
host: true,
open: true, // 可选:启动时自动打开浏览器
proxy: {
'/api': {
target: 'http://10.10.1.34:8888', // 目标服务器的地址
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
});