From b5b41a081af264864db87742aa7f0e06f87f14e1 Mon Sep 17 00:00:00 2001 From: Nicholas Duffy Date: Fri, 3 Apr 2020 08:21:05 -0600 Subject: [PATCH] fix(gatsby-plugin-benchmark-reporting): Update pageCount to use NUM_PAGES (#22766) * Update pageCount to use NUM_PAGES * parseInt for NUM_PAGES environment --- .../gatsby-plugin-benchmark-reporting/src/gatsby-node.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/gatsby-plugin-benchmark-reporting/src/gatsby-node.js b/packages/gatsby-plugin-benchmark-reporting/src/gatsby-node.js index 7e08286af4645..41635f2e006c9 100644 --- a/packages/gatsby-plugin-benchmark-reporting/src/gatsby-node.js +++ b/packages/gatsby-plugin-benchmark-reporting/src/gatsby-node.js @@ -157,11 +157,6 @@ class BenchMeta { `find public .cache -type f -iname "*.bmp" -or -iname "*.tif" -or -iname "*.webp" -or -iname "*.svg" | wc -l` ) - const pageCount = glob(`**/**.json`, { - cwd: `./public/page-data`, - nocase: true, - }).length - const benchmarkMetadata = this.getMetadata() return { @@ -181,7 +176,7 @@ class BenchMeta { webpack: webpackVersion, }, counts: { - pages: pageCount, + pages: parseInt(process.env.NUM_PAGES), jpgs: jpgCount, pngs: pngCount, gifs: gifCount,