Merge pull request #1095 from kennyt/patch-5

Small refactor for getting size
This commit is contained in:
Tobias Koppers 2015-05-21 21:48:53 +02:00
commit 1c9558da5f
1 changed files with 3 additions and 3 deletions

View File

@ -114,9 +114,9 @@ CommonsChunkPlugin.prototype.apply = function(compiler) {
reallyUsedModules.push(module);
});
if(minSize) {
var size = reallyUsedModules.map(function(module) {
return module.size();
}).reduce(function(a, b) { return a + b; }, 0);
var size = reallyUsedModules.reduce(function(a, b) {
return a + b.size();
}, 0);
if(size < minSize)
return;
}