Nuxt.js: How to define webpack on config.nuxt.js

Created on 24 Dec 2017  路  2Comments  路  Source: nuxt/nuxt.js

Hi,

I need to define webpack but I am just looking what is the best way to define it... cuz nuxt config is a little bit weird for me even though I am loving it and I am building my app on it.

Following these instructions here: https://gist.github.com/rvanzon/6028e884f6735c41125fb2d140143102 where I wanted to reduce chunk size.

So I added this line:
if (!this.dev) { config.plugins.push(new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 3 })) }

And now I am getting error that webpack is not defined.

Thnx in advance for any help.

This question is available on Nuxt.js community (#c2124)

Most helpful comment

Do you have this line at the top of the file?

const webpack = require('webpack');

All 2 comments

Do you have this line at the top of the file?

const webpack = require('webpack');

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shyamchandranmec picture shyamchandranmec  路  3Comments

bimohxh picture bimohxh  路  3Comments

vadimsg picture vadimsg  路  3Comments

mikekidder picture mikekidder  路  3Comments

mattdharmon picture mattdharmon  路  3Comments