Skip to content

Commit 72627ef

Browse files
committed
fix: mitigate netlify javascript heap out of memory issue
1 parent b5dfa18 commit 72627ef

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/.vitepress/config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ import {
55
localIconLoader
66
} from 'vitepress-plugin-group-icons'
77

8+
let buildConcurrency: number
9+
try {
10+
const { cpus } = await import('os')
11+
buildConcurrency = 4 * cpus().length
12+
} catch {
13+
// edge services may not expose os module
14+
buildConcurrency = 16
15+
}
16+
817
export default defineConfig({
918
title: 'VitePress',
1019

@@ -15,6 +24,7 @@ export default defineConfig({
1524
lastUpdated: true,
1625
cleanUrls: true,
1726
metaChunk: true,
27+
buildConcurrency,
1828

1929
markdown: {
2030
math: true,

0 commit comments

Comments
 (0)