aboutsummaryrefslogtreecommitdiff
path: root/node_modules/webpack/lib/optimize/CommonsChunkPlugin.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
commit0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch)
treef9864d4a4148621378958794cbbfdc2393733283 /node_modules/webpack/lib/optimize/CommonsChunkPlugin.js
parent6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff)
upgrade dependencies
Diffstat (limited to 'node_modules/webpack/lib/optimize/CommonsChunkPlugin.js')
-rw-r--r--node_modules/webpack/lib/optimize/CommonsChunkPlugin.js20
1 files changed, 10 insertions, 10 deletions
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);
}