跳到主要內容

distDir

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

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

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

現在,如果您執行 next build,Next.js 將使用 build 而不是預設的 .next 資料夾。

distDir 不應 離開您的專案目錄。例如,../build 是一個無效的目錄。