Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 758 Bytes

setting-a-custom-build-directory.md

File metadata and controls

28 lines (20 loc) · 758 Bytes
description
Set a custom build directory to use instead of the default .next directory.

Setting a custom build directory

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

Open next.config.js and add the distDir config:

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

Now if you run next build Next.js will use build instead of the default .next folder.

distDir should not leave your project directory. For example, ../build is an invalid directory.

Related