perf: add webpack production optimizations
Some checks failed
continuous-integration/drone/push Build is failing

- Extract CSS to separate files for better caching
- Split vendor chunks for optimized loading
- Remove console.log statements in production builds
- Disable source maps in production
- Configure terser for better compression

These optimizations should reduce bundle size and improve page load performance.
This commit is contained in:
Joris Slagter
2025-12-08 10:24:06 +01:00
parent f6c6c1620c
commit 1bb4dd6374

View File

@@ -189,6 +189,32 @@ export default {
/*
** You can extend webpack config here
*/
extend(config, ctx) {},
extractCSS: true, // Extract CSS into separate files
optimization: {
splitChunks: {
chunks: 'all',
automaticNameDelimiter: '.',
name: undefined,
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
priority: -10
}
}
}
},
terser: {
terserOptions: {
compress: {
drop_console: true // Remove console.log in production
}
}
},
extend(config, ctx) {
// Disable source maps in production
if (!ctx.isDev) {
config.devtool = false
}
},
}
}