/// import {defineConfig} from 'vitest/config' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' // https://vite.dev/config/ export default defineConfig({ plugins: [react(), tailwindcss()], // Base path per il frontend servito su /badge // NOTA: trailing slash importante per generare URL corretti degli asset base: '/badge/', // Build nella cartella dist del frontend build: { outDir: 'dist', emptyOutDir: true, }, // Configurazione test Vitest test: { globals: true, environment: 'jsdom', setupFiles: ['./src/test/setup.ts'], include: ['src/**/*.{test,spec}.{js,ts,jsx,tsx}'], coverage: { provider: 'v8', reporter: ['text', 'html'], exclude: ['node_modules/', 'src/test/'], }, }, // Proxy API in sviluppo verso il backend (porta 8000) // In produzione il backend serve il frontend su /badge e le API su /api/* server: { proxy: { '/api': { target: 'http://127.0.0.1:8000', changeOrigin: true, }, }, }, })