/// import react from "@vitejs/plugin-react"; import { defineConfig } from "vitest/config"; // The SPA talks to the FastAPI backend on :8000 via a same-origin proxy, so the // browser makes no cross-origin calls in dev. Override the target with // VITE_API_TARGET when :8000 is occupied. Screen-shaped /api/* endpoints arrive in // SLICE-2/3 (SD-0001 ยง6.4). const apiTarget = process.env.VITE_API_TARGET || "http://localhost:8000"; export default defineConfig({ plugins: [react()], server: { port: 5173, proxy: { "/api": apiTarget, }, }, // Tests live alongside source; scoping the include to src/ keeps the runner out of // node_modules (and any stray local backup dirs) without naming them. test: { include: ["src/**/*.test.{ts,tsx}"], }, });