import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; export default defineConfig({ optimizeDeps: { exclude: ["epanet-js/engines/v2.3.5"], }, plugins: [react()], server: { host: "127.0.0.1", port: 5173, proxy: { "/api": "http://127.0.0.1:8000", }, }, // Intranet serving (`npm run serve:lan`): the built app is exposed on all // interfaces, while the analysis API stays bound to 127.0.0.1 and is reached // only through this same-origin /api proxy (no CORS, API not exposed). preview: { host: "0.0.0.0", port: 8080, strictPort: true, proxy: { "/api": "http://127.0.0.1:8000", }, }, });