perf: render pages asynchronously (#1320)

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
pull/1325/head
Sanjaiyan Parthipan 2 years ago committed by GitHub
parent c39a10515c
commit 8e4ff4de90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save