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"), }, }, }, }; });