콘텐츠로 이동

next.config.js 옵션: generateBuildId

next.config.js 옵션: generateBuildId | Next.js

섹션 제목: “next.config.js 옵션: generateBuildId | Next.js”

Source URL: https://nextjs.org/docs/pages/api-reference/config/next-config-js/generateBuildId

최종 업데이트 2026년 2월 20일

Next.js는 애플리케이션에서 제공 중인 버전을 식별하기 위해 next build 동안 ID를 생성합니다. 동일한 빌드를 사용해 여러 컨테이너를 부팅해야 합니다.

환경의 각 단계를 다시 빌드한다면 컨테이너 간에 사용할 일관된 빌드 ID를 생성해야 합니다. next.config.js에서 generateBuildId 명령을 사용하세요:

next.config.js

module.exports = {
generateBuildId: async () => {
// This could be anything, using the latest git hash
return process.env.GIT_HASH
},
}