diff --git a/nuxt.config.js b/nuxt.config.js index 1b939f3..5f62a2e 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -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 + } + }, } }