mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? - Added separate links for the app and pages router in the shared documentation. - Added comment at the top of all shared documentation. - Fixed typos in pages documentation comment. ### Why? - To limit the switching between the different routers in shared documentation when clicking the links.
21 lines
780 B
Plaintext
21 lines
780 B
Plaintext
---
|
|
title: distDir
|
|
description: Set a custom build directory to use instead of the default .next directory.
|
|
---
|
|
|
|
{/* The content of this doc is shared between the app and pages router. 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. */}
|
|
|
|
You can specify a name to use for a custom build directory to use instead of `.next`.
|
|
|
|
Open `next.config.js` and add the `distDir` config:
|
|
|
|
```js filename="next.config.js"
|
|
module.exports = {
|
|
distDir: 'build',
|
|
}
|
|
```
|
|
|
|
Now if you run `next build` Next.js will use `build` instead of the default `.next` folder.
|
|
|
|
> `distDir` **should not** leave your project directory. For example, `../build` is an **invalid** directory.
|