diff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjs index bad353b9f2..49a29ae267 100644 --- a/apps/docs/next.config.mjs +++ b/apps/docs/next.config.mjs @@ -7,6 +7,13 @@ const withMDX = createMDX(); const config = { reactStrictMode: true, output: 'standalone', + experimental: { + // The docs site prerenders 400+ MDX pages. Next spawns one static-generation + // worker per CPU, and on Vercel's high-core build container that fan-out + // multiplied the resident set until the build was OOM-killed (exit 137). + // Cap the worker count so peak memory stays well under the container limit. + cpus: 2, + }, typescript: { ignoreBuildErrors: false, }, diff --git a/apps/docs/package.json b/apps/docs/package.json index 95e186f1ec..961a0de278 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -6,7 +6,7 @@ "license": "Apache-2.0", "scripts": { "dev": "next dev", - "build": "pnpm --filter @objectstack/spec gen:schema && pnpm --filter @objectstack/spec gen:docs && next build", + "build": "pnpm --filter @objectstack/spec gen:schema && pnpm --filter @objectstack/spec gen:docs && NODE_OPTIONS='--max-old-space-size=4096' next build", "site:start": "next start", "site:lint": "next lint", "types:check": "fumadocs-mdx && next typegen && tsc --noEmit",