Skip to content

Commit d03203d

Browse files
author
inuscript
committed
change async variable name
1 parent 73886d5 commit d03203d

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

lib/optimize/CommonsChunkPlugin.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function CommonsChunkPlugin(options) {
3232
this.minChunks = options.minChunks;
3333
this.selectedChunks = options.chunks;
3434
if(options.children) this.selectedChunks = false;
35-
this.async = options.async;
35+
this.asyncOption = options.async;
3636
this.minSize = options.minSize;
3737
this.ident = __filename + (nextIdent++);
3838
}
@@ -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.asyncOption;
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)