import { readFileSync } from 'node:fs' import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' // The app's own version, from the single source of truth (package.json), baked // in at build time as __APP_VERSION__ (used by the startup update check). const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')) // Proxy /api to the FastAPI backend so the frontend can use same-origin fetches. export default defineConfig({ plugins: [react()], define: { __APP_VERSION__: JSON.stringify(pkg.version), }, server: { port: 5173, proxy: { '/api': 'http://localhost:8000', }, }, })