distDir

您可以指定一個自訂建置目錄名稱來取代 .next

開啟 next.config.js 並新增 distDir 設定:

next.config.js
module.exports = {
  distDir: 'build',
}

現在當您執行 next build 時,Next.js 將會使用 build 而非預設的 .next 資料夾。

distDir 不應指向專案目錄之外。例如 ../build無效的目錄。