Skip to content

Commit 3285a22

Browse files
committed
fix(DST-1904): limit worker threads to Vercel preview and production builds
VERCEL is also set by `vercel dev` on a developer machine. VERCEL_ENV is 'preview' or 'production' only on Vercel's build machines, so local runs on macOS, where fsevents can trigger nodejs/node#65100, keep Next's default.
1 parent ed5d51b commit 3285a22

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎docs/next.config.mjs‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ const config = {
1414
},
1515
reactStrictMode: true,
1616
experimental: {
17-
// On Vercel, run webpack loaders (mostly the MDX compile) in worker threads
18-
// instead of a pool of child processes, to keep the build's peak memory under
19-
// the 8 GB limit (DST-1904). `force` skips Next's fallback on Node >= 24.13.1,
20-
// which guards against https://github.com/nodejs/node/issues/65100. Its known
21-
// trigger is fsevents, which is macOS-only, so local builds keep the default.
22-
turbopackPluginRuntimeStrategy: process.env.VERCEL
17+
// On Vercel preview and production builds, run webpack loaders (mostly the
18+
// MDX compile) in worker threads instead of a pool of child processes, to keep
19+
// the build's peak memory under the 8 GB limit (DST-1904). `force` skips Next's
20+
// fallback on Node >= 24.13.1, which guards against
21+
// https://github.com/nodejs/node/issues/65100. Its known trigger is fsevents,
22+
// which is macOS-only, so local runs (including `vercel dev`) keep the default.
23+
turbopackPluginRuntimeStrategy: ['preview', 'production'].includes(
24+
process.env.VERCEL_ENV
25+
)
2326
? 'forceWorkerThreads'
2427
: undefined,
2528
},

0 commit comments

Comments
 (0)