Unverified Commit 4f19d01c authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

docs: `experimental.isolatedDevBuild` (#84656)

This doc is mainly to provide the users with information on how to opt
out of this feature. We could later remove these docs and the option
when the need to opt out is low.

---------
Co-authored-by: 's avatarJoseph Chamochumbi <joseph.chamochumbi@vercel.com>
parent 18c99b60
---
title: isolatedDevBuild
description: Use isolated build outputs for development server to prevent conflicts with production builds.
version: experimental
---
The experimental `isolatedDevBuild` option separates development and production build outputs into different directories. When enabled, the development server (`next dev`) writes its output to `.next/dev` instead of `.next`, preventing conflicts when running `next dev` and `next build` concurrently.
This is especially helpful when automated tools (for example, AI agents) run `next build` to validate changes while your development server is running, ensuring the dev server is not affected by changes made by the build process.
This feature is **enabled by default** to keep development and production outputs separate and prevent conflicts.
## Configuration
To opt out of this feature, set `isolatedDevBuild` to `false` in your configuration:
```ts filename="next.config.ts" switcher
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
experimental: {
isolatedDevBuild: false, // defaults to true
},
}
export default nextConfig
```
```js filename="next.config.mjs" switcher
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
isolatedDevBuild: false, // defaults to true
},
}
export default nextConfig
```
## Version History
| Version | Changes |
| --------- | ---------------------------------------------- |
| `v16.0.0` | `experimental.isolatedDevBuild` is introduced. |
---
title: isolatedDevBuild
description: Use isolated directories for development builds to prevent conflicts with production builds.
source: app/api-reference/config/next-config-js/isolatedDevBuild
---
{/* DO NOT EDIT. The content of this doc is generated from the source above. To edit the content of this page, navigate to the source page in your editor. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment