// defineConfig from vitest/config is a superset of vite's — it accepts the // `test` block. Importing it here keeps vite.config.ts the single source of // truth for both the dev/build config and the test config. import { defineConfig } from 'vitest/config'; import react from '@vitejs/plugin-react'; export default defineConfig({ plugins: [react()], server: { port: 5174, proxy: { '/api': { target: 'http://localhost:8080', changeOrigin: false, }, '/health': { target: 'http://localhost:8080', changeOrigin: false, }, }, }, build: { outDir: 'dist', sourcemap: true, }, test: { environment: 'jsdom', setupFiles: ['./src/test/setup.ts'], css: false, // AntD's reset.css is imported in main.tsx — skip it for tests. // No `globals: true` — test files import describe/it/expect/vi from 'vitest' // explicitly. Less magic, no tsconfig types array required. }, });