Skip to main content
Vertz apps can be deployed as fully static sites — no server required. The build script SSR-renders your pages at build time, bundles client JS for interactivity, and outputs a dist/ directory you can deploy anywhere. This guide uses Cloudflare Workers, but the output works with any static host.

When to use this

Static deployment is ideal for:
  • Landing pages
  • Marketing sites
  • Documentation
  • Any page where content doesn’t change per-request
If your app needs per-request SSR (dynamic data, auth, personalized content), use a Cloudflare Worker with SSR instead.

Project structure

A static Vertz site has the same structure as any Vertz UI app:

App entry

Your app.tsx exports the app component and SSR metadata — same as any Vertz app:

Client entry

The client entry hydrates the server-rendered HTML for interactivity:

Dev server

For local development, use the standard Vertz dev server: The vtz runtime includes a built-in dev server with HMR, SSR, and the Vertz compiler — no additional configuration required. Just run:

Build script

The build script produces a self-contained dist/ directory. It:
  1. Builds the client JS bundle with the Vertz compiler plugin
  2. Extracts CSS from component css() calls
  3. Copies public assets to dist/public/
  4. SSR-renders the page by starting the dev server and capturing its output
  5. Strips dev-only scripts (HMR, WebSocket overlay, reload guard)
  6. Injects production head tags (meta, OG, fonts, client bundle reference)
The build script starts the dev server temporarily to SSR-render the page. This ensures the production HTML matches exactly what you see in development — same components, same data, same CSS. The dev server is killed immediately after the fetch.

Injecting meta tags

The build script is where you add production-only <head> content — meta descriptions, Open Graph tags, fonts, etc. Inject them after the <title> tag:
For generating OG images programmatically, see the OG Images guide.

Wrangler configuration

Configure Cloudflare Workers to serve from dist/:
The not_found_handling = "single-page-application" setting returns index.html for any path that doesn’t match a file — this lets client-side routing work.

Package scripts

Deploy

The output is a clean dist/ directory:
The dev server’s SSR output includes HMR scripts, WebSocket overlays, and dev server bootstrapping code. The build script strips all of these — never deploy the raw dev server output directly.

How it differs from full-stack deployment

Static siteFull-stack (Workers)
ServerNone — static files onlyCloudflare Worker with SSR
DataBuild-time onlyPer-request (queries, auth)
Build outputdist/ with HTML + JS + CSSdist/client/ + dist/server/
Use caseLanding pages, marketingApps with dynamic data
Commandvtz run buildvtz run build

SSG with generateParams

Pre-render dynamic routes at build time

OG Images

Generate Open Graph images for social sharing

SSR

Server-side rendering for dynamic apps