From 4a5721e12ff93978df28acf28e6264840592325c Mon Sep 17 00:00:00 2001 From: Yoel Date: Mon, 21 Mar 2022 14:45:05 -0400 Subject: [PATCH 1/3] Add option for always showing gzip diff --- compare.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compare.js b/compare.js index b9d48ca..b2ba9f2 100755 --- a/compare.js +++ b/compare.js @@ -275,7 +275,7 @@ function renderSize(d, showBudgetDiff) { const gzd = d.gzipDiff const percentChange = (gzd / d.gzip) * 100 return ` | \`${filesize(d.gzip)}\`${ - gzd && !showBudgetDiff + (gzd && !showBudgetDiff) || options.alwaysShowGzipDiff ? ` _(${renderStatusIndicator(percentChange)}${filesize(gzd)})_` : '' }` From f0afe89b48a3ebebe1a12f91c25fa930d6a568dd Mon Sep 17 00:00:00 2001 From: Yoel Date: Mon, 21 Mar 2022 14:48:41 -0400 Subject: [PATCH 2/3] Add description to README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4b8bfe0..9626cd3 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,10 @@ For example, if you build to `dist`, you should: (Optional, defaults to `0`) The threshold under which pages will be considered unchanged. For example, if `minimumChangeThreshold` was set to `500` and a page's size increased by `300 B`, it will be considered unchanged. +### `alwaysShowGzipDiff (boolean)` + +(Optional, defaults to `false`) If set, the display table will show the gzip size difference for routes even when a budget is set. + ## Caveats - This plugin only analyzes the direct bundle output from next.js. If you have added any other scripts via the `