feat(slice-1): Vite/React shell + /api proxy; scripts/check.sh now fully green
Single tsconfig (no project-references split — avoids composite/noEmit friction for the minimal shell); tsc typechecks src, vite loads its config via esbuild. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
// 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,
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user