import path from "path"; import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; // During dev (`pnpm dev`), Vite serves on :5173 and proxies /api + /mcp + /health // to the FastAPI server on :8765 (or PORT env var). const BACKEND_PORT = process.env.BACKEND_PORT || "8765"; export default defineConfig({ plugins: [react()], resolve: { alias: { "@": path.resolve(__dirname, "./src"), }, }, server: { port: 5173, proxy: { "/api": `http://127.0.0.1:${BACKEND_PORT}`, "/mcp": `http://127.0.0.1:${BACKEND_PORT}`, "/health": `http://127.0.0.1:${BACKEND_PORT}`, }, }, build: { outDir: "dist", sourcemap: false, }, });