- Switch from Terser to esbuild minifier (Vite's default) - Set target to es2015 for better browser compatibility - Remove manual chunking that was causing load order issues - Result: 3MB bundle (down from 6.5MB) with proper minification This should resolve the production build errors caused by improper chunk loading order and duplicate module bundling. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
31 lines
755 B
TypeScript
31 lines
755 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
import path from "path";
|
|
import { componentTagger } from "lovable-tagger";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(({ mode }) => ({
|
|
server: {
|
|
host: "::",
|
|
port: 8080,
|
|
},
|
|
plugins: [react(), mode === "development" && componentTagger()].filter(Boolean),
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
build: {
|
|
// Use esbuild minification (default) instead of Terser
|
|
minify: 'esbuild',
|
|
target: 'es2015',
|
|
// Optimize dependencies for better bundling
|
|
rollupOptions: {
|
|
output: {
|
|
// Prevent code splitting issues
|
|
inlineDynamicImports: false,
|
|
},
|
|
},
|
|
},
|
|
}));
|