import path from 'node:path' import tailwindcss from '@tailwindcss/vite' import { tanstackRouter } from '@tanstack/router-plugin/vite' import react from '@vitejs/plugin-react' import { defineConfig } from 'vite' const srcDir = path.resolve(import.meta.dirname, './src') export default defineConfig({ plugins: [ // Must run before react(): it watches `src/routes` and generates `routeTree.gen.ts`. tanstackRouter({ target: 'react', autoCodeSplitting: true }), react(), tailwindcss(), ], resolve: { alias: { '@': srcDir, }, }, server: { port: 7153, // Same-origin API in dev, mirroring nginx in production: the browser calls // `/api/*` on the Vite server and it is forwarded to the Bun API. proxy: { '/api': 'http://localhost:4100', }, }, })