import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import tailwindcss from '@tailwindcss/vite'; import { tanstackRouter } from '@tanstack/router-plugin/vite'; import devServer from '@hono/vite-dev-server'; import { fileURLToPath, URL } from 'node:url'; export default defineConfig({ plugins: [ // Must run before the React plugin so the generated route tree is in place. tanstackRouter({ target: 'react', autoCodeSplitting: true }), react(), tailwindcss(), // Serves the Hono API in dev. Everything outside /api falls through to // Vite, which serves the SPA. devServer({ entry: 'server/app.ts', exclude: [/^(?!\/api(\/|$)).*/], injectClientScript: false, }), ], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), }, }, build: { outDir: 'dist/client', }, });