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:
parent
e1babdfe9d
commit
c79d2676d2
|
@ -85,6 +85,10 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
|
||||||
name: 'commons',
|
name: 'commons',
|
||||||
filename: 'commons.js',
|
filename: 'commons.js',
|
||||||
minChunks (module, count) {
|
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
|
// NOTE: it depends on the fact that the entry funtion is always called
|
||||||
// before applying CommonsChunkPlugin
|
// before applying CommonsChunkPlugin
|
||||||
return count >= minChunks
|
return count >= minChunks
|
||||||
|
|
Loading…
Reference in a new issue