Skip to content

Commit

Permalink
perf: render pages asynchronously (#1320)
Browse files Browse the repository at this point in the history
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
  • Loading branch information
sanjaiyan-dev and brc-dd committed Sep 11, 2022
1 parent c39a105 commit 8e4ff4d
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/node/build/build.ts
Expand Up @@ -65,18 +65,20 @@ export async function build(

const pages = ['404.md', ...siteConfig.pages]

for (const page of pages) {
await renderPage(
render,
siteConfig,
page,
clientResult,
appChunk,
cssChunk,
pageToHashMap,
hashMapString
await Promise.all(
pages.map((page) =>
renderPage(
render,
siteConfig,
page,
clientResult,
appChunk,
cssChunk,
pageToHashMap,
hashMapString
)
)
}
)
} catch (e) {
spinner.stopAndPersist({
symbol: failMark
Expand Down

0 comments on commit 8e4ff4d

Please sign in to comment.