rsnext/docs/api-reference/next.config.js/setting-a-custom-build-directory.md
Luis Alvarez D 7fc850e28a [docs] Added related links to next.config.js (#10174)
* Added related links

* Added missing dots
2020-01-20 21:40:20 +01:00

28 lines
758 B
Markdown

---
description: Set a custom build directory to use instead of the default .next directory.
---
# Setting a custom build directory
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
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.
## Related
<div class="card">
<a href="/docs/api-reference/next.config.js/introduction.md">
<b>Introduction to next.config.js:</b>
<small>Learn more about the configuration file used by Next.js.</small>
</a>
</div>