From 0469abd4a9c9270a1fdc962969e36e63699af8b4 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 10 Dec 2017 21:51:33 +0100 Subject: upgrade dependencies --- .../webpack/lib/optimize/CommonsChunkPlugin.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'node_modules/webpack/lib/optimize/CommonsChunkPlugin.js') diff --git a/node_modules/webpack/lib/optimize/CommonsChunkPlugin.js b/node_modules/webpack/lib/optimize/CommonsChunkPlugin.js index ab7b69f4a..c0e438a40 100644 --- a/node_modules/webpack/lib/optimize/CommonsChunkPlugin.js +++ b/node_modules/webpack/lib/optimize/CommonsChunkPlugin.js @@ -107,7 +107,7 @@ You can however specify the name of the async chunk by passing the desired strin /** * These chunks are subject to get "common" modules extracted and moved to the common chunk */ - const affectedChunks = this.getAffectedChunks(compilation, chunks, targetChunk, targetChunks, idx, this.selectedChunks, this.async, this.children); + const affectedChunks = this.getAffectedChunks(compilation, chunks, targetChunk, targetChunks, idx, this.selectedChunks, this.async, this.children, this.deepChildren); // bail if no chunk is affected if(!affectedChunks) { @@ -214,7 +214,7 @@ You can however specify the name of the async chunk by passing the desired strin Take a look at the "name"/"names" or async/children option.`); } - getAffectedUnnamedChunks(affectedChunks, targetChunk, asyncOption) { + getAffectedUnnamedChunks(affectedChunks, targetChunk, rootChunk, asyncOption, deepChildrenOption) { let chunks = targetChunk.chunks; chunks && chunks.forEach((chunk) => { if(chunk.isInitial()) { @@ -225,11 +225,11 @@ Take a look at the "name"/"names" or async/children option.`); // b) themselves affected chunks // we can assume that this chunk is an affected chunk too, as there is no way a chunk that // isn't only depending on the target chunk is a parent of the chunk tested - if(asyncOption || chunk.parents.every((parentChunk) => parentChunk === targetChunk || affectedChunks.has(parentChunk))) { + if(asyncOption || chunk.parents.every((parentChunk) => parentChunk === rootChunk || affectedChunks.has(parentChunk))) { // This check not only dedupes the affectedChunks but also guarantees we avoid endless loops - if(!affectedChunks.has(chunk) || affectedChunks.values().next().value === chunk) { + if(!affectedChunks.has(chunk)) { // We mutate the affected chunks before going deeper, so the deeper levels and other branches - // Have the information of this chunk being affected for their assertion if a chunk should + // have the information of this chunk being affected for their assertion if a chunk should // not be affected affectedChunks.add(chunk); @@ -237,16 +237,16 @@ Take a look at the "name"/"names" or async/children option.`); // This guarantees that if a chunk should be an affected chunk, // at the latest the last connection to the same chunk meets the // condition to add it to the affected chunks. - if(this.deepChildren === true) { - this.getAffectedUnnamedChunks(affectedChunks, chunk, asyncOption); + if(deepChildrenOption === true) { + this.getAffectedUnnamedChunks(affectedChunks, chunk, rootChunk, asyncOption, deepChildrenOption); } } } }); } - getAffectedChunks(compilation, allChunks, targetChunk, targetChunks, currentIndex, selectedChunks, asyncOption, children) { - const asyncOrNoSelectedChunk = children || asyncOption; + getAffectedChunks(compilation, allChunks, targetChunk, targetChunks, currentIndex, selectedChunks, asyncOption, childrenOption, deepChildrenOption) { + const asyncOrNoSelectedChunk = childrenOption || asyncOption; if(Array.isArray(selectedChunks)) { return allChunks.filter(chunk => { @@ -258,7 +258,7 @@ Take a look at the "name"/"names" or async/children option.`); if(asyncOrNoSelectedChunk) { let affectedChunks = new Set(); - this.getAffectedUnnamedChunks(affectedChunks, targetChunk, asyncOption); + this.getAffectedUnnamedChunks(affectedChunks, targetChunk, targetChunk, asyncOption, deepChildrenOption); return Array.from(affectedChunks); } -- cgit v1.2.3