always add the first asset to the size list #1676 (#1678)

This commit is contained in:
Peter Hedenskog 2017-07-21 09:04:13 +02:00 committed by GitHub
parent 07462406c6
commit bc5379164c
1 changed files with 4 additions and 4 deletions

View File

@ -35,17 +35,17 @@ module.exports = {
if (this.largestAssets[asset.type]) {
this.largestAssets[asset.type].add(asset, page, runPage);
} else {
this.largestAssets[asset.type] = new AssetsBySize(maxSize, asset, page);
this.largestAssets[asset.type] = new AssetsBySize(maxSize);
this.largestAssets[asset.type].add(asset, page, runPage);
}
if (this.largestAssetsByGroup[group][asset.type]) {
this.largestAssetsByGroup[group][asset.type].add(asset, page, runPage);
} else {
this.largestAssetsByGroup[group][asset.type] = new AssetsBySize(
maxSize,
asset,
page
maxSize
);
this.largestAssetsByGroup[group][asset.type].add(asset, page, runPage);
}
this.slowestAssets.add(asset, page, runPage);