Spaces:
Sleeping
Sleeping
| import { defineConfig } from 'vite' | |
| import react from '@vitejs/plugin-react' | |
| // https://vite.dev/config/ | |
| export default defineConfig({ | |
| plugins: [react()], | |
| build: { | |
| // Basic minification (rolldown-vite compatible) | |
| minify: true, | |
| // Optimize chunk size | |
| chunkSizeWarningLimit: 1000, | |
| rollupOptions: { | |
| output: { | |
| manualChunks(id) { | |
| // Split vendor libraries for better caching | |
| if (id.includes('node_modules')) { | |
| // Separate heavy libraries into their own chunks | |
| if (id.includes('framer-motion')) { | |
| return 'framer-motion'; | |
| } | |
| if (id.includes('papaparse')) { | |
| return 'papaparse'; | |
| } | |
| if (id.includes('lucide-react')) { | |
| return 'lucide-react'; | |
| } | |
| // Everything else goes to vendor | |
| return 'vendor'; | |
| } | |
| }, | |
| // Optimize file naming for cache busting | |
| entryFileNames: 'assets/[name]-[hash].js', | |
| chunkFileNames: 'assets/[name]-[hash].js', | |
| assetFileNames: 'assets/[name]-[hash].[ext]' | |
| }, | |
| }, | |
| // Source maps disabled in production for smaller size | |
| sourcemap: false, | |
| }, | |
| // Optimize dependencies | |
| optimizeDeps: { | |
| include: ['react', 'react-dom', 'papaparse'], | |
| }, | |
| }) | |