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,8 +65,9 @@ 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) =>
renderPage(
render, render,
siteConfig, siteConfig,
page, page,
@ -76,7 +77,8 @@ export async function build(
pageToHashMap, pageToHashMap,
hashMapString hashMapString
) )
} )
)
} catch (e) { } catch (e) {
spinner.stopAndPersist({ spinner.stopAndPersist({
symbol: failMark symbol: failMark

Loading…
Cancel
Save