Skip to content

Commit

Permalink
fix issue when bundle don't have metrics at all (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSensor authored and ryan-roemer committed Nov 8, 2017
1 parent 4f56a22 commit 338cc53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion utils/format-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function resolveAssets(tree, bundles) {
const realBundleMatch = _.find({ path: asset.name })(bundles);
return realBundleMatch ? {
name: realBundleMatch.path,
size: realBundleMatch.metrics.meta.bundle.minGz,
size: realBundleMatch.metrics ? realBundleMatch.metrics.meta.bundle.minGz : 0,
minGz: true
} : asset;
})
Expand Down
2 changes: 1 addition & 1 deletion utils/format-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function groupModules(bundle) {
});
}),
_.orderBy(_.get("size.minGz"), "desc")
)(bundle.metrics.sizes);
)(bundle.metrics ? bundle.metrics.sizes : []);
}

// Get the sum of all module groups' min+gz size.
Expand Down

0 comments on commit 338cc53

Please sign in to comment.