import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; export default defineConfig({ plugins: [react()], // In production the SPA is served same-origin behind Caddy, which proxies /api and // /nats to the cluster; those relative paths do not exist on the bare dev server, so // `pnpm dev` must be pointed at a real cluster node with VITE_BUS_HTTP / VITE_BUS_WS // (busService.ts uses them as overrides of the same-origin defaults). Example: // VITE_BUS_HTTP=https://:8470 VITE_BUS_WS=wss://:8480 pnpm dev // The dev server runs on 5174 (5173 is reserved for an unrelated local app). Add the // dev origin (http://localhost:5174) to the node's --cors-origins allowlist. strictPort // is left off, so Vite falls back to the next free port if 5174 is busy. server: { host: true, port: 5174, }, });