Skip to content

Commit 0eec407

Browse files
committed
better optimize
1 parent 0df6162 commit 0eec407

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎lib/optimize/LimitChunkCountPlugin.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ LimitChunkCountPlugin.prototype.apply = function(compiler) {
2727
var CHUNK_OVERHEAD = options.chunkOverhead || 10000;
2828
var ENTRY_CHUNK_MULTIPLICATOR = options.entryChunkMultiplicator || 10;
2929

30-
while(chunks.length > maxChunks) {
30+
if(chunks.length > maxChunks) {
3131
var combinations = [];
3232
chunks.forEach(function(a, idx) {
3333
for(var i = 0; i < idx; i++) {
@@ -59,8 +59,8 @@ LimitChunkCountPlugin.prototype.apply = function(compiler) {
5959

6060
pair[2].integrate(pair[3], "limit");
6161
chunks.splice(chunks.indexOf(pair[3]), 1);
62+
this.restartApplyPlugins();
6263
}
63-
this.restartApplyPlugins();
6464
});
6565
});
6666
};

0 commit comments

Comments
 (0)