Cover
Foto profil

Bembi Pramudya

@beemind

Hi! I am Bembi Pramudya, a developer from Indonesia. I spend my free time building software, tinkering with web tools, and exploring frontend design.

DeveloperIndonesiabembee.cc
Web

Migrating to Next.js Static Export

Bembi Pramudya
Bembi PramudyaSep 20, 2026 · 3 min read
Migrating to Next.js Static Export

A single HTML file is fast, but as pages grow — projects, blog, gallery, detail pages — everything becomes hard to maintain. File-based routing in Next.js solves this: every page becomes its own component.

The interesting part: with output: export, the build output is still pure HTML, CSS, and JS files. No Node server needs to run. That means it can be hosted free on GitHub Pages, as fast as static HTML.

// next.config.mjs
const nextConfig = {
  output: "export",  // result: out/ folder with static files
};

One thing to watch: every page must be renderable at build time. Dynamic data like API fetches needs a fallback, since no server handles it at runtime.

When to move to a framework? When routing gets complex, article pages multiply, or you need reusable components. For this portfolio, the time had come — and there are no regrets.