43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://backend:3000',
|
|
changeOrigin: true,
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
sourcemap: false,
|
|
chunkSizeWarningLimit: 1500,
|
|
// 'esnext' reduces CPU usage by avoiding heavy transpilation for older browsers
|
|
target: 'esnext',
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: (id) => {
|
|
if (id.includes('node_modules')) {
|
|
if (id.includes('react-markdown') || id.includes('remark') || id.includes('rehype')) {
|
|
return 'markdown';
|
|
}
|
|
if (id.includes('lucide-react')) {
|
|
return 'icons';
|
|
}
|
|
if (id.includes('@google/genai')) {
|
|
return 'genai';
|
|
}
|
|
if (id.includes('react') || id.includes('react-dom')) {
|
|
return 'react-vendor';
|
|
}
|
|
return 'vendor';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|