Skip to content

Commit a1815f8

Browse files
authored
Merge pull request webpack#3431 from inuscript/async-flag
change internal async variable name (CommonsChunkPlugin)
2 parents 73886d5 + 4bf2ba4 commit a1815f8

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/optimize/CommonsChunkPlugin.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ CommonsChunkPlugin.prototype.apply = function(compiler) {
4343
var filenameTemplate = this.filenameTemplate;
4444
var minChunks = this.minChunks;
4545
var selectedChunks = this.selectedChunks;
46-
var async = this.async;
46+
var asyncOption = this.async;
4747
var minSize = this.minSize;
4848
var ident = this.ident;
4949
compiler.plugin("this-compilation", function(compilation) {
@@ -53,7 +53,7 @@ CommonsChunkPlugin.prototype.apply = function(compiler) {
5353
compilation[ident] = true;
5454

5555
var commonChunks;
56-
if(!chunkNames && (selectedChunks === false || async)) {
56+
if(!chunkNames && (selectedChunks === false || asyncOption)) {
5757
commonChunks = chunks;
5858
} else if(Array.isArray(chunkNames) || typeof chunkNames === "string") {
5959
commonChunks = [].concat(chunkNames).map(function(chunkName) {
@@ -75,10 +75,10 @@ CommonsChunkPlugin.prototype.apply = function(compiler) {
7575
if(chunk === commonChunk) return false;
7676
return selectedChunks.indexOf(chunk.name) >= 0;
7777
});
78-
} else if(selectedChunks === false || async) {
78+
} else if(selectedChunks === false || asyncOption) {
7979
usedChunks = (commonChunk.chunks || []).filter(function(chunk) {
8080
// we can only move modules from this chunk if the "commonChunk" is the only parent
81-
return async || chunk.parents.length === 1;
81+
return asyncOption || chunk.parents.length === 1;
8282
});
8383
} else {
8484
if(commonChunk.parents.length > 0) {
@@ -91,8 +91,8 @@ CommonsChunkPlugin.prototype.apply = function(compiler) {
9191
return chunk.hasRuntime();
9292
});
9393
}
94-
if(async) {
95-
var asyncChunk = this.addChunk(typeof async === "string" ? async : undefined);
94+
if(asyncOption) {
95+
var asyncChunk = this.addChunk(typeof asyncOption === "string" ? asyncOption : undefined);
9696
asyncChunk.chunkReason = "async commons chunk";
9797
asyncChunk.extraAsync = true;
9898
asyncChunk.addParent(commonChunk);
@@ -144,7 +144,7 @@ CommonsChunkPlugin.prototype.apply = function(compiler) {
144144
commonChunk.addModule(module);
145145
module.addChunk(commonChunk);
146146
});
147-
if(async) {
147+
if(asyncOption) {
148148
reallyUsedChunks.forEach(function(chunk) {
149149
if(chunk.isInitial())
150150
return;

0 commit comments

Comments
 (0)