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] const pages = ['404.md', ...siteConfig.pages]
for (const page of pages) { await Promise.all(
await renderPage( pages.map((page) =>
render, renderPage(
siteConfig, render,
page, siteConfig,
clientResult, page,
appChunk, clientResult,
cssChunk, appChunk,
pageToHashMap, cssChunk,
hashMapString pageToHashMap,
hashMapString
)
) )
} )
} catch (e) { } catch (e) {
spinner.stopAndPersist({ spinner.stopAndPersist({
symbol: failMark symbol: failMark

Loading…
Cancel
Save