/// import tailwindcss from '@tailwindcss/vite' import react from '@vitejs/plugin-react' import { fileURLToPath } from 'node:url' import { defineConfig } from 'vite' // The dev server proxies /api to a running sondad; set SONDA_URL to point elsewhere. const target = process.env.SONDA_URL ?? 'http://127.0.0.1:8080' export default defineConfig({ plugins: [react(), tailwindcss()], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) }, }, // The build goes where the Go server embeds it (build sondad with -tags webui). It is outside the web // folder, so Vite has to be told that it may empty it. build: { outDir: '../internal/webui/dist', emptyOutDir: true, }, server: { proxy: { '/api': { target, changeOrigin: false } }, }, test: { environment: 'jsdom', setupFiles: ['./src/test/setup.ts'], css: false, }, })