import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' // https://vite.dev/config/ export default defineConfig({ plugins: [react(), tailwindcss()], // CRITICAL: base path must match the nginx subpath and FastAPI root_path base: '/postgenerator/', server: { proxy: { // In dev, proxy /postgenerator/api -> localhost:8000/api // rewrite strips the /postgenerator prefix so FastAPI sees /api/... '/postgenerator/api': { target: 'http://localhost:8000', changeOrigin: true, rewrite: (path) => path.replace('/postgenerator', ''), }, }, }, })