mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Closes: https://linear.app/vercel/issue/DOC-4686/clean-up-routing-section Redirects: https://github.com/vercel/front/pull/47151 --------- Co-authored-by: Joseph <[email protected]> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
20 lines
947 B
Plaintext
20 lines
947 B
Plaintext
---
|
|
title: generateBuildId
|
|
description: Configure the build id, which is used to identify the current build in which your application is being served.
|
|
---
|
|
|
|
{/* 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. */}
|
|
|
|
Next.js generates an ID during `next build` to identify which version of your application is being served. The same build should be used and boot up multiple containers.
|
|
|
|
If you are rebuilding for each stage of your environment, you will need to generate a consistent build ID to use between containers. Use the `generateBuildId` command in `next.config.js`:
|
|
|
|
```jsx filename="next.config.js"
|
|
module.exports = {
|
|
generateBuildId: async () => {
|
|
// This could be anything, using the latest git hash
|
|
return process.env.GIT_HASH
|
|
},
|
|
}
|
|
```
|