Capítulo 214 de 456
generateBuildId lets you control the build ID Next.js uses to identify which application version is served, needed for consistent IDs across multiple containers built independently per environment stage.
generateBuildId: async function in next.config.js returning a string used as the build ID.deploymentId: when deploymentId is set, Next.js uses a constant build ID and this function has no effect; version skew is detected from the deployment ID instead.module.exports = {
generateBuildId: async () => {
// This could be anything, using the latest git hash
return process.env.GIT_HASH
},
}
deploymentId estiver configurado, essa função é ignorada.