Skip to content

Commit 8e4ff4d

Browse files
perf: render pages asynchronously (#1320)
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
1 parent c39a105 commit 8e4ff4d

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/node/build/build.ts

+13-11
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,20 @@ export async function build(
6565

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

68-
for (const page of pages) {
69-
await renderPage(
70-
render,
71-
siteConfig,
72-
page,
73-
clientResult,
74-
appChunk,
75-
cssChunk,
76-
pageToHashMap,
77-
hashMapString
68+
await Promise.all(
69+
pages.map((page) =>
70+
renderPage(
71+
render,
72+
siteConfig,
73+
page,
74+
clientResult,
75+
appChunk,
76+
cssChunk,
77+
pageToHashMap,
78+
hashMapString
79+
)
7880
)
79-
}
81+
)
8082
} catch (e) {
8183
spinner.stopAndPersist({
8284
symbol: failMark

0 commit comments

Comments
 (0)