How it works
When you runvertz build, the build pipeline:
- Builds client and server bundles
- Discovers all routes from your app
- Collects pre-renderable paths (static routes +
generateParamsexpansions) - Renders each path to a complete HTML file
- Writes them to
dist/client/<path>/index.html
<script> tags stripped — zero JavaScript shipped.
Mark routes for pre-rendering
Addprerender: true to any static route:
prerender are not pre-rendered. Routes with prerender: false are explicitly skipped.
Dynamic routes with generateParams
For routes with :param segments, provide a generateParams function that returns all param combinations to pre-render:
dist/client/blog/intro-to-vertz/index.htmldist/client/blog/reactive-signals/index.htmldist/client/blog/type-safe-routing/index.html
generateParams is implicitly pre-rendered — you don’t need prerender: true.
Fetching params from a data source
generateParams can be async. Fetch slugs from a database, CMS, or API:
Multiple params
For routes with multiple dynamic segments, return objects with all param keys:Export routes from your app
Forvertz build to discover generateParams, export your routes from app.tsx:
routes export to collect pre-render paths.
Nested routes
Parent and child routes are independent for pre-rendering. A parent withprerender: false does not prevent its children from being pre-rendered:
Build output
Aftervertz build, pre-rendered pages are in dist/client/:
When to use SSG vs SSR
SSG (prerender: true) | SSR (default) | |
|---|---|---|
| Rendered | Once, at build time | Every request |
| Data | Build-time only | Per-request (fresh) |
| Performance | Instant — served from CDN | Server render + data fetch |
| Use case | Blog posts, docs, landing pages | Dashboards, auth-gated pages |
Troubleshooting
”Pre-render failed for /path”
The route’s component or loader threw during build-time rendering. Common causes:- The loader depends on runtime-only data (auth, cookies, request headers)
- A component accesses
windowordocumentunconditionally
prerender: false to the route, or guard browser-only code:
“generateParams returned params missing key”
The objects returned bygenerateParams don’t include all :param segments in the route pattern. Check that every dynamic segment has a matching key in each returned object.
Static Sites
Deploy a static Vertz site to Cloudflare Workers
SSR
Server-side rendering for dynamic apps