From 2572744538eb8e60017aa64b187b29ba24604372 Mon Sep 17 00:00:00 2001 From: Madeline Miller Date: Tue, 3 May 2022 21:53:49 +1000 Subject: [PATCH] perf: minify page-data --- packages/gatsby/src/utils/page-data-helpers.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/gatsby/src/utils/page-data-helpers.ts b/packages/gatsby/src/utils/page-data-helpers.ts index f33b0da63c080..64d28f1a385cb 100644 --- a/packages/gatsby/src/utils/page-data-helpers.ts +++ b/packages/gatsby/src/utils/page-data-helpers.ts @@ -20,20 +20,19 @@ export function constructPageDataString( }: IPageData, result: string | Buffer ): string { - let body = `{ - "componentChunkName": "${componentChunkName}", - "path": ${JSON.stringify(pagePath)}, - "result": ${result}, - "staticQueryHashes": ${JSON.stringify(staticQueryHashes)}` + let body = + `{` + + `"componentChunkName":"${componentChunkName}",` + + `"path":${JSON.stringify(pagePath)},` + + `"result":${result},` + + `"staticQueryHashes":${JSON.stringify(staticQueryHashes)}` if (matchPath) { - body += `, - "matchPath": "${matchPath}"` + body += `,"matchPath":"${matchPath}"` } if (manifestId) { - body += `, - "manifestId": "${manifestId}"` + body += `,"manifestId":"${manifestId}"` } body += `}`