import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; // Path-prefix-aware build. Apache serves the SPA at /programme-pulse/. // Vite bakes this into asset URLs so the manual API_BASE hack isn't needed. export default defineConfig({ base: '/programme-pulse/', plugins: [react()], server: { port: 5173, // Mirror prod paths in local dev: API calls hit /programme-pulse/api/* → forwarded to Flask :5051. proxy: { '/programme-pulse/api': { target: 'http://localhost:5051', changeOrigin: true, // Strip the /programme-pulse prefix so Flask sees /api/... rewrite: (p) => p.replace(/^\/programme-pulse/, ''), }, }, }, build: { outDir: 'dist', sourcemap: true, }, });