2026-03-12 16:33:33 +08:00
|
|
|
import { defineConfig, loadEnv } from "vite";
|
|
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
|
|
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
|
|
|
const env = loadEnv(mode, process.cwd(), "");
|
|
|
|
|
return {
|
|
|
|
|
plugins: [react()],
|
|
|
|
|
server: {
|
|
|
|
|
port: 4000,
|
|
|
|
|
proxy: {
|
|
|
|
|
"/planning-api": {
|
|
|
|
|
target: env.VITE_PLANNING_API_BASE || "http://localhost:8090",
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => path.replace(/^\/planning-api/, "/api"),
|
|
|
|
|
},
|
|
|
|
|
"/devops-api": {
|
|
|
|
|
target: env.VITE_DEVOPS_API_BASE || "http://localhost:8000",
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => path.replace(/^\/devops-api/, ""),
|
|
|
|
|
},
|
|
|
|
|
"/quality-api": {
|
|
|
|
|
target: env.VITE_QUALITY_API_BASE || "http://localhost:5000",
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => path.replace(/^\/quality-api/, "/api"),
|
|
|
|
|
},
|
2026-03-13 21:11:24 +08:00
|
|
|
"/task-api": {
|
|
|
|
|
target: env.VITE_QUALITY_API_BASE || "http://localhost:8080",
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => path.replace(/^\/task-api/, "/api"),
|
|
|
|
|
},
|
2026-03-12 16:33:33 +08:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
});
|