| 1 | import tailwindcss from '@tailwindcss/vite' |
| 2 | import react from '@vitejs/plugin-react' |
| 3 | import { defineConfig } from 'vitest/config' |
| 4 | |
| 5 | export default defineConfig({ |
| 6 | plugins: [react(), tailwindcss()], |
| 7 | server: { |
| 8 | // The browser calls /api on this server, and Vite hands it to nginx: |
| 9 | // one origin, so no CORS. In production nginx does the same. |
| 10 | proxy: { |
| 11 | '/api': { |
| 12 | target: 'http://localhost:8080', |
| 13 | rewrite: (path) => path.replace(/^\/api/, ''), |
| 14 | }, |
| 15 | }, |
| 16 | }, |
| 17 | test: { environment: 'jsdom' }, |
| 18 | }) |