distDir

您可以指定一个自定义构建目录名称来替代 .next

打开 next.config.js 并添加 distDir 配置:

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

现在运行 next build 时,Next.js 将使用 build 目录而非默认的 .next 文件夹。

distDir 不应超出您的项目目录。例如,../build无效的目录路径。