Building Static Export

Before building a static export, you have to uncomment these scripts in next.config.js located in the root folder.

/** @type {import('next').NextConfig} */
const nextConfig = {
  output: 'export',
  distDir: 'build',
  images: {
    unoptimized: true,
  },
};

module.exports = nextConfig;

Then you can build a static export using:

yarn build

or

npm run build

The default output directory will be in the ./build directory.

Last updated