Enable turbopackFileSystemCacheForBuild by default (#96395)
### What? Makes `experimental.turbopackFileSystemCacheForBuild` (Turbopack's on-disk filesystem cache for `next build`) enabled by default, matching the dev-mode flag. It stays disabled by default in non-Vercel CI environments, and can always be turned off explicitly with `experimental.turbopackFileSystemCacheForBuild: false`. ### Why? The build filesystem cache greatly speeds up warm builds, but was previously opt-in (only auto-enabled for canary builds on the Vercel builder). Defaulting it on gives everyone faster subsequent builds, while keeping it off in non-Vercel CI where the cache is unlikely to persist between builds. ### How? - `turbopackFileSystemCacheForBuildDefault()` now returns `true` except when `isCI && !NOW_BUILDER` (removed the `isStableBuild()` gate). - The explicit `false` opt-out already works via the existing `config.experimental?.turbopackFileSystemCacheForBuild || false` read. - Adds an e2e test (`test/e2e/app-dir/turbopack-fs-cache-build-default`) asserting `.next/cache/turbopack` is written by default, empty when the flag is `false`, and empty in non-Vercel CI. - Updates the `turbopackFileSystemCache` / Turbopack docs. <!-- NEXT_JS_LLM --> --------- Co-authored-by:vercel-fleet[bot] <308483924+vercel-fleet[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
Showing
Please
register
or
sign in
to comment