We can add this back now (should fix CI)
Dan Abramov committed
Dec 23, 2017 at 22:31 UTC
021a567793aa85310cfc39aa9bfcbaa1aaaaecef
1 file changed
+24
scripts/rollup/stats.js
+24
@@ -41,6 +41,30 @@ function printResults() {
41
chalk.gray.yellow('Diff'),
42
],
43
});
44
+ currentBuildResults.bundleSizes.forEach(index => {
45
+ const result = currentBuildResults.bundleSizes[index];
46
+ const prev = prevBuildResults.bundleSizes.filter(
47
+ res => res.filename === result.filename
48
+ )[0];
49
+ if (result === prev) {
50
+ // We didn't rebuild this bundle.
51
+ return;
52
+ }
53
+
54
+ const size = result.size;
55
+ const gzip = result.gzip;
56
+ let prevSize = prev ? prev.size : 0;
57
+ let prevGzip = prev ? prev.gzip : 0;
58
+ table.push([
59
+ chalk.white.bold(`${result.filename} (${result.bundleType}`),
60
+ chalk.gray.bold(filesize(prevSize)),
61
+ chalk.white.bold(filesize(size)),
62
+ percentChange(prevSize, size),
63
+ chalk.gray.bold(filesize(prevGzip)),
64
+ chalk.white.bold(filesize(gzip)),
65
+ percentChange(prevGzip, gzip),
66
+ ]);
67
+ });
68
return table.toString();
69
}
70