refactor: rendering pages as batch

pull/3285/head^2
David Silva 2 years ago
parent 6be80372ad
commit f2b1c1ffa6

@ -106,8 +106,13 @@ export async function build(
}
}
const pages = ['404.md', ...siteConfig.pages]
const batchSize = 100
for (let i = 0; i < pages.length; i += batchSize) {
const batch = pages.slice(i, i + batchSize)
await Promise.all(
['404.md', ...siteConfig.pages]
batch
.map((page) => siteConfig.rewrites.map[page] || page)
.map((page) =>
renderPage(
@ -124,6 +129,7 @@ export async function build(
)
)
)
}
})
// emit page hash map for the case where a user session is open

Loading…
Cancel
Save