Skip to content

Commit 4f19d01

Browse files
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: Joseph Chamochumbi <[email protected]>
1 parent 18c99b6 commit 4f19d01

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: isolatedDevBuild
3+
description: Use isolated build outputs for development server to prevent conflicts with production builds.
4+
version: experimental
5+
---
6+
7+
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.
8+
9+
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.
10+
11+
This feature is **enabled by default** to keep development and production outputs separate and prevent conflicts.
12+
13+
## Configuration
14+
15+
To opt out of this feature, set `isolatedDevBuild` to `false` in your configuration:
16+
17+
```ts filename="next.config.ts" switcher
18+
import type { NextConfig } from 'next'
19+
20+
const nextConfig: NextConfig = {
21+
experimental: {
22+
isolatedDevBuild: false, // defaults to true
23+
},
24+
}
25+
26+
export default nextConfig
27+
```
28+
29+
```js filename="next.config.mjs" switcher
30+
/** @type {import('next').NextConfig} */
31+
const nextConfig = {
32+
experimental: {
33+
isolatedDevBuild: false, // defaults to true
34+
},
35+
}
36+
37+
export default nextConfig
38+
```
39+
40+
## Version History
41+
42+
| Version | Changes |
43+
| --------- | ---------------------------------------------- |
44+
| `v16.0.0` | `experimental.isolatedDevBuild` is introduced. |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: isolatedDevBuild
3+
description: Use isolated directories for development builds to prevent conflicts with production builds.
4+
source: app/api-reference/config/next-config-js/isolatedDevBuild
5+
---
6+
7+
{/* 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. */}

0 commit comments

Comments
 (0)