Static Exports

Next.js enables starting as a static site or Single-Page Application (SPA), then later optionally upgrading to use features that require a server.

Static Exports

Step 1: Uncomment output and images properties in next.config.mjs
/** @type {import('next').NextConfig} */
const nextConfig = {
  // output: "export", // UNCOMMENT TO ENABLE STATIC EXPORT.
  // images: { unoptimized: true }, // UNCOMMENT TO ENABLE STATIC EXPORT.
};

export default nextConfig;
Step 2: Run yarn build or npm run build on your terminal

After running next build, Next.js will produce an out folder which contains the HTML/CSS/JS assets for your application. It can be deployed and hosted on any web server that can serve HTML/CSS/JS static assets.

Step 3: Run npx serve@latest out on your terminal

It will be served on your local web server. You can now view your application in your browser.

Think unique and be creative. Make a difference with Sandbox.

Everything you need to create your next unique and professional website, including impressive and ready-made blocks and pages.

Buy Sandbox
demo