Skip to content

Commit 1c9558d

Browse files
committed
Merge pull request webpack#1095 from kennyt/patch-5
Small refactor for getting size
2 parents d898ca8 + 7edffc3 commit 1c9558d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/optimize/CommonsChunkPlugin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ CommonsChunkPlugin.prototype.apply = function(compiler) {
114114
reallyUsedModules.push(module);
115115
});
116116
if(minSize) {
117-
var size = reallyUsedModules.map(function(module) {
118-
return module.size();
119-
}).reduce(function(a, b) { return a + b; }, 0);
117+
var size = reallyUsedModules.reduce(function(a, b) {
118+
return a + b.size();
119+
}, 0);
120120
if(size < minSize)
121121
return;
122122
}

0 commit comments

Comments
 (0)