1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Disable common chunks plugin in dev. (#1311)

With the on-demand-entires, this makes no sense.
This commit is contained in:
Arunoda Susiripala 2017-02-28 11:19:49 +05:30 committed by Guillermo Rauch
parent e1babdfe9d
commit c79d2676d2

View file

@ -85,6 +85,10 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
name: 'commons',
filename: 'commons.js',
minChunks (module, count) {
// In the dev we use on-deman-entries.
// So, it makes no sense to use commonChunks with that.
if (dev) return false
// NOTE: it depends on the fact that the entry funtion is always called
// before applying CommonsChunkPlugin
return count >= minChunks