Disable minification completely to fix production errors
Disabled minification entirely as Terser continued to cause variable collision errors even with conservative settings. Changes: - Set minify: false in vite.config.ts - This eliminates all minification-related variable conflicts - Trade-off: Bundle size 3MB → 6.5MB (unminified) - The app should now load correctly in production This is a temporary solution. The root cause appears to be related to how the codebase is structured causing Terser to create duplicate identifiers during chunk optimization. Next steps could include: - Investigating code duplication issues - Switching to esbuild minifier - Restructuring problematic imports 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,38 +16,7 @@ export default defineConfig(({ mode }) => ({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
minify: 'terser',
|
// Disable minification completely to avoid variable conflicts
|
||||||
terserOptions: {
|
minify: false,
|
||||||
compress: {
|
|
||||||
// Prevents variable name conflicts
|
|
||||||
sequences: false,
|
|
||||||
properties: false,
|
|
||||||
dead_code: true,
|
|
||||||
drop_debugger: true,
|
|
||||||
unsafe: false,
|
|
||||||
conditionals: true,
|
|
||||||
comparisons: true,
|
|
||||||
evaluate: false,
|
|
||||||
booleans: true,
|
|
||||||
loops: true,
|
|
||||||
hoist_funs: false,
|
|
||||||
if_return: true,
|
|
||||||
join_vars: false,
|
|
||||||
drop_console: false,
|
|
||||||
reduce_funcs: false,
|
|
||||||
reduce_vars: false,
|
|
||||||
},
|
|
||||||
mangle: {
|
|
||||||
// Disable mangling to prevent variable name conflicts
|
|
||||||
eval: false,
|
|
||||||
keep_fnames: true,
|
|
||||||
reserved: [],
|
|
||||||
},
|
|
||||||
format: {
|
|
||||||
// Preserve code formatting to avoid issues
|
|
||||||
comments: false,
|
|
||||||
beautify: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user