rsnext/docs/api-reference/next.config.js/configuring-the-build-id.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

27 lines
906 B
Markdown

---
description: Configure the build id, which is used to identify the current build in which your application is being served.
---
# Configuring the Build ID
Next.js uses a constant id generated at build time to identify which version of your application is being served. This can cause problems in multi-server deployments when `next build` is ran on every server. In order to keep a static build id between builds you can provide your own build id.
Open `next.config.js` and add the `generateBuildId` function:
```js
module.exports = {
generateBuildId: async () => {
// You can, for example, get the latest git commit hash here
return 'my-build-id'
},
}
```
## 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>