# 设置自定义生成目录

You can specify a name to use for a custom build directory to use instead of .next.

Open next.config.jsand add the distDirconfig:

module.exports = {
  distDir: 'build',
}

Now if you run next buildNext.js will use buildinstead of the default .nextfolder.

distDirshould notleave your project directory. For example, ../buildis an invaliddirectory.

Introduction to next.config.jsLearn more about the configuration file used by Next.js.

Last Updated: 5/13/2023, 8:55:38 PM