import path from 'path' import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' import { TanStackRouterVite } from '@tanstack/router-plugin/vite' export default defineConfig({ plugins: [ TanStackRouterVite({ routesDirectory: './src/routes', target: 'react', autoCodeSplitting: true, }), react(), tailwindcss(), ], build: { rollupOptions: { output: { manualChunks(id) { if ( /node_modules[\\/](recharts|victory-vendor|d3-[a-z-]+|react-smooth|recharts-scale)[\\/]/.test( id, ) ) { return 'charts' } if (/node_modules[\\/]@dnd-kit[\\/]/.test(id)) return 'dnd' if ( /node_modules[\\/](react|react-dom|scheduler|clsx|tailwind-merge)[\\/]/.test( id, ) ) { return 'react' } if (/node_modules[\\/]@tanstack[\\/]react-router[\\/]/.test(id)) { return 'router' } if (/node_modules[\\/]@tanstack[\\/]react-query[\\/]/.test(id)) { return 'query' } return undefined }, }, }, }, resolve: { alias: { '@': path.resolve(__dirname, './src'), '@evofw/shared': path.resolve( __dirname, '../../packages/shared/src/index.ts', ), '@evofw/ui/components': path.resolve( __dirname, '../../packages/ui/src/components', ), '@evofw/ui/hooks': path.resolve( __dirname, '../../packages/ui/src/hooks', ), '@evofw/ui/lib': path.resolve(__dirname, '../../packages/ui/src/lib'), }, }, server: { port: 5177, fs: { allow: [path.resolve(__dirname, '../..')] }, proxy: { '/api': 'http://localhost:8080', '/health': 'http://localhost:8080', '/ready': 'http://localhost:8080', '/v1': 'http://localhost:8080', }, }, })