import { resolve } from 'node:path' import { defineConfig } from 'vite' import viteReact from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' import { TanStackRouterVite } from '@tanstack/router-plugin/vite' // https://vitejs.dev/config/ export default defineConfig({ plugins: [ TanStackRouterVite({ autoCodeSplitting: true }), viteReact(), tailwindcss(), ], test: { globals: true, environment: 'jsdom', }, resolve: { alias: { '@': resolve(__dirname, './src'), }, }, server: { // On Prod the frontend are just static file served directly by the backend node.js. // On Dev we connect instead to the Vite server. proxy: { '/api': { target: 'http://localhost:3000', changeOrigin: true, cookieDomainRewrite: '', cookiePathRewrite: '/', }, }, }, })