Static site generation (SSG)
Prerender every page to static HTML at build time, then deploy the result anywhere.
On this pageTurn on static output · Override it per page · Compare SSG with edge prerendering
This step prerenders every page at build time. Set output: "static" in void.config.ts.
json
{
"output": "static"
}With output: "static":
- Pages default to
prerender = trueand are written as HTML files todist/client/. - To opt a page out, add
export const prerender = falseto its.server.ts. That page renders on request. - Dynamic pages without
getPrerenderPaths()are not prerendered. Their paths are unknown at build time. - The output is self-contained. It works with direct Cloudflare deploys, self-hosting or
void deploy.
Per-page overrides
This step opts one page out of prerendering.
ts
// pages/dashboard.server.ts
export const prerender = false;This step prerenders a dynamic page. getPrerenderPaths() returns the params to render.
ts
// pages/blog/[slug].server.ts
export async function getPrerenderPaths() {
return [{ slug: 'hello-world' }, { slug: 'getting-started' }];
}Comparison with edge prerendering
output value | Default prerender | Per-page override | Prerender timing |
|---|---|---|---|
"server" (default) | false | export const prerender = true | Deploy-time (platform ISR) |
"static" | true | export const prerender = false | Build or deploy post-build |
With the default output: "server", use export const prerender = true for deploy-time edge prerendering.
Deployment behavior
void deploy picks the deployment type for you:
- Fully static: every page is prerendered, with no API routes, middleware, cron jobs or queues. The SDK deploys a static site with no worker.
- Hybrid: some pages cannot be prerendered, such as dynamic pages without
getPrerenderPaths()or pages withprerender = false. A worker serves those routes at runtime. Prerendered pages are still static assets.
Relationship to inference.appType: "static"
inference.appType describes the app type: SPA, static or void. output sets the rendering strategy.
inference.appType: "static" | output: "static" | |
|---|---|---|
| What | Deploy a pre-built static site (no SDK plugin) | Prerender an SDK app at build time |
| Worker | None (static assets only) | Only if some pages can't be prerendered |
| Use case | VitePress, plain HTML, external SSG tools | SDK apps with mostly or fully static content |