Deployment Overview

Introduction

ReeWeb generates a fully static site - HTML, CSS, JavaScript, images, and fonts. There is no server process to keep running, no database connection to maintain, and no runtime to monitor. The output in dist/ can be deployed to any static file host.

The Generated Output

Running bun ssg produces a dist/ directory with this structure:

dist/
├── index.html              ← Default language homepage
├── about/
│   └── index.html          ← Default language /about/
├── en/
│   ├── index.html          ← English homepage
│   └── about/
│       └── index.html      ← English /about/
├── blog/
│   └── post-title/
│       └── index.html      ← Blog post
├── css/
│   └── style.css           ← Compiled Tailwind CSS
├── _redirects              ← Cloudflare-style redirect rules
├── favicon.ico
└── ...

Each page is rendered as index.html inside a directory named after the URL path. This is the standard pattern for static hosting - example.com/about/ serves about/index.html automatically on most hosts.

Choosing a Host

Any static file host that serves index.html from directories works with ReeWeb. The most common options:

HostNotes
Cloudflare PagesReads _redirects natively, global CDN, generous free tier
NetlifyReads _redirects natively, form handling available
VercelZero-config, automatic HTTPS, global CDN
GitHub PagesFree for public repositories, push dist/ to gh-pages branch
S3 + CloudFrontFull control, pay-per-request pricing
Any VPSServe with nginx, Caddy, or any static file server

Optional: Edge Worker on Cloudflare

Static-first does not mean static-only. On Cloudflare you can put a small optional edge worker in front of the static assets to rewrite the already-rendered HTML per request - the visitor's edge location, an A/B bucket, a request-dependent header. The template ships this worker at cf-worker.ts, disabled by default so a fresh site deploys as pure static assets.

This is edge enrichment, not runtime rendering: pages are still generated as HTML ahead of time, and the worker only post-processes that HTML. See Cloudflare Edge Worker for the full pattern.

Previewing Locally

Before deploying, preview the generated site:

bun ssg
bun preview

The preview server (scripts/preview.ts) serves dist/ on http://localhost:3000 with proper MIME types and directory index resolution. It detects language subdirectories automatically.

Quick Online Preview with Cloudflare Drop

To share the generated site or check it on a real URL without setting anything up, Cloudflare Drop deploys dist/ to Cloudflare's global network from the browser - no account required. Drag the dist/ folder (or a zip of it) onto the page and it goes live in seconds.

The deployment is temporary: it stays active for 60 minutes, then expires unless you claim it by signing up for a Cloudflare account. Drag-and-drop is capped at 1,000 files, 25 MiB per file, which is ample for a typical ReeWeb generated site.

This is ideal for a quick look or a link to send a reviewer. For a permanent deployment, use Cloudflare Pages or another host below.

Environment Variables for Production

Set SITE_URL in your production environment before static site generation:

SITE_URL=https://example.com

When set, the SSG script generates hreflang alternate links for each language - required by Google for multi-language SEO. Without it, hreflang links are skipped (the site still generates and works correctly).

Common Tasks

  • Rebuilding on every push - see the individual deployment pages for CI/CD configuration
  • Custom domains - configure through your host's dashboard
  • HTTPS - all modern static hosts provide automatic HTTPS
  • Cache headers - set long cache durations on the versioned CSS file, short cache on HTML