⚡️ Optimize production build configuration with chunk splitting, source maps, and increased asset limits
This commit is contained in:
@@ -9,6 +9,28 @@ export default defineConfig({
|
|||||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
build: {
|
||||||
|
// Production build optimizations
|
||||||
|
target: 'es2015',
|
||||||
|
minify: 'terser',
|
||||||
|
sourcemap: true, // Enable source maps for production debugging
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
manualChunks: {
|
||||||
|
// Split vendor chunks for better caching
|
||||||
|
'vue-vendor': ['vue', 'vue-router'],
|
||||||
|
'highlight': ['highlight.js'],
|
||||||
|
'virtual-scroller': ['vue-virtual-scroller']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Increase chunk size warning limit (default is 500kb)
|
||||||
|
chunkSizeWarningLimit: 600,
|
||||||
|
// Enable CSS code splitting
|
||||||
|
cssCodeSplit: true,
|
||||||
|
// Asset inlining threshold (10kb)
|
||||||
|
assetsInlineLimit: 10240
|
||||||
|
},
|
||||||
server: {
|
server: {
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
port: 5173,
|
port: 5173,
|
||||||
|
|||||||
Reference in New Issue
Block a user