To reduce the number of chunks of your project build with Nuxt.js add the next lines:
if (!this.dev) {
config.plugins.push(new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 3
}))
}
right under extend (config, ctx) {
of nuxt.config.js
.
Then build your project with npm run build
. Et voilà, No more than 3 chunks :-)
Loading times of my pages went from 1.2s to 600ms!
Another thing to try and fiddle with:
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 15
}),
new webpack.optimize.MinChunkSizePlugin({
minChunkSize: 10000
})
Made 5 bundles (besides the vendor and nuxt)
@rvanzon It no longer works, unfortunately, getting error: