import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
  plugins: [react()],
  server: {
    proxy: {
      // En dev local, proxy /api → Symfony (port 8000)
      '/api': {
        target:      'http://localhost:8000',
        changeOrigin: true,
      },
    },
  },
  build: {
    outDir:    '../backend/public',
    emptyOutDir: false, // ne pas supprimer index.php, .htaccess Symfony, etc.
  },
});
