import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import path from 'node:path'; export default defineConfig({ plugins: [react()], resolve: { alias: { '@': path.resolve(__dirname, './src'), // Stub out node:crypto to avoid bundling @agentkitai/agentlens-core hash utilities // (dashboard only needs types + constant arrays from core) 'node:crypto': path.resolve(__dirname, './src/stubs/crypto.ts'), }, }, server: { port: 5173, proxy: { '/api': { target: 'http://localhost:3400', changeOrigin: true, }, }, }, build: { outDir: 'dist', sourcemap: true, rollupOptions: { output: { // Function form (object form isn't supported by Vite 8's Rolldown bundler). manualChunks: (id) => (id.includes('node_modules/recharts') ? 'recharts' : undefined), }, }, }, });