From 000bcaffd4e4acff364713867f76cbdccf71cf53 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 19 Nov 2020 17:00:03 -0500 Subject: [PATCH] chore: avoid unnecessary iteration for ssr build --- src/node/build/bundle.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node/build/bundle.ts b/src/node/build/bundle.ts index 0506ec2a..fa67d211 100644 --- a/src/node/build/bundle.ts +++ b/src/node/build/bundle.ts @@ -85,10 +85,13 @@ export async function bundle( }, generateBundle(_options, bundle) { + if (!isClientBuild) { + return + } // for each .md entry chunk, adjust its name to its correct path. for (const name in bundle) { const chunk = bundle[name] - if (isPageChunk(chunk) && isClientBuild) { + if (isPageChunk(chunk)) { // record page -> hash relations const hash = chunk.fileName.match(hashRE)![1] const pageName = chunk.fileName.replace(hashRE, '')