Build Modes

SSG (default)

Full static generation. Every prerenderable route becomes route/index.html. Run on any host.

node build.mjs

ISG

Incremental Static Generation. Only generates routes that don't yet exist or are stale. Out-of-the-box on hosts that support it (Cloudflare Pages, Netlify, Vercel) — the same Worker entry handles cache misses by rendering and writing back to R2.

node isg.mjs

Stream SSR

The same compiled modules can be streamed with web-standard ReadableStream. Each component flushes as soon as its data is ready. Try the demo:

node stream.mjs

You'll see chunks arrive over time (200ms between each).

Cloudflare Workers

cd workers
wrangler dev          # local
wrangler deploy       # production

The same dist/ works for both static-only and Worker deploys. Static assets served by the assets binding; SSR routes hit the Worker.