Scripts Reference
ReeWeb's package.json defines a set of scripts for static site generation, development, and maintenance. This page lists every script with its exact command and purpose.
Development Scripts
| Script | Command | Description |
|---|---|---|
bun dev | bun scripts/dev/orchestrate.ts | One-shot setup (asset sync, image prep, initial CSS build), then the CSS watcher and dev server run side by side |
bun preview | bun scripts/preview.ts | Serve the generated dist/ output locally to verify the production site |
How bun dev Works
bun dev runs scripts/dev/orchestrate.ts, which performs the one-shot setup steps (bun dynamic:sync, image preparation, and an initial CSS build - dynamic:sync is a no-op unless REEPOLEE_API_URL is set, see below), then spawns two long-running processes side by side:
tailwindcss --watch=always- the Tailwind CSS watcher, recompiling on every file change (--watch=alwaysis required: without it the watcher exits as soon as its stdin closes)bun --hot --no-clear-screen scripts/dev.ts- the dev server (scripts/dev.ts), serving templates with live reload
The orchestrator also watches .env and config/ and restarts the whole dev child process when either changes (Bun's --hot can't pick up those at runtime). Open http://localhost:3000 once they are running.
Dynamic Asset Sync (dynamic:sync)
| Script | Command | Description |
|---|---|---|
bun dynamic:sync | bun scripts/sync_dynamic_assets.ts | Pull Reepolee-managed images and files into the project before SSG |
When a ReeWeb site is paired with a Reepolee app as its data source,
dynamic:sync fetches the assets (images and documents) referenced by
Reepolee-managed data and writes them into the project so they ship as static
files. It reads the Reepolee origin from REEPOLEE_API_URL and skips silently
when that variable is unset, so a standalone ReeWeb site is unaffected. It runs
first in both bun dev and bun ssg, and is incremental (pass --force to
re-sync everything). See ReeWeb & Reepolee
for the data-source model.
The dev server is documented in detail on the Dev Server page.
SSG Scripts
| Script | Command | Description |
|---|---|---|
bun prepare:images | bun scripts/prepare_images.ts | Generate responsive image variants from assets/images/ (see below) |
bun ssg | bun dynamic:sync && bun prepare:images && bun css:build && bun scripts/ssg.ts … && bun og:images && bun sitemap && bun rss && bun ssg:search | Full production SSG: synced assets, fresh images, built CSS, rendered pages, OG cards, sitemap, RSS, and search index |
Responsive Images (prepare:images)
scripts/prepare_images.ts turns full-size originals in assets/images/ into
width-stepped WebP + JPEG variants in src/public/images/responsive/
(git-ignored), using Bun's native Bun.Image - no external dependency. It runs
before bun ssg and as one of bun dev's one-shot setup steps, and is
incremental (mtime-based): warm runs are near-instant, and editing one original
rebuilds only that image.
Widths and quality live in config/responsive_images.ts. See the
Responsive Images recipe for detail.
| Flag | Default | Description |
|---|---|---|
--widths <list> | from config/responsive_images | Comma-separated width breakpoints |
--quality <n> | from config/responsive_images | Quality for both formats (1-100) |
--quality-webp <n> / --quality-jpeg <n> | 80 / 80 | Per-format quality |
--force | off | Re-encode even if outputs exist |
SSG Options
All SSG scripts accept these options via command-line flags:
bun scripts/ssg.ts [options]
| Flag | Default | Description |
|---|---|---|
--public <dir> | ./src/public | Source directory with .ree templates |
--dist <dir> | ./dist | Output directory for static HTML |
--base-url <url> | / | Base URL for the site |
--site-url <url> | empty | Full site URL for hreflang links |
--verbose | off | Log each rendered file |
Pass --verbose directly for verbose output:
bun scripts/ssg.ts --public ./src/public --dist ./dist --verbose
The SSG pipeline is documented on the SSG Pipeline page.
CSS Scripts
| Script | Command | Description |
|---|---|---|
bun css:build | tailwindcss -i ./src/css/style.css -o ./src/public/css/style.min.css --minify | One-time CSS build (minified), output to src/public/css/style.min.css |
bun css:watch | tailwindcss -i ./src/css/style.css -o ./src/public/css/style.min.css --minify --watch | Watch mode - recompiles on every file change, same output path |
Note: bun ssg includes the CSS build, image preparation, sitemap generation, and RSS generation for a complete production-ready generation pass.
The Tailwind setup is documented on the Tailwind CSS Setup page.
SEO Scripts
| Script | Command | Description |
|---|---|---|
bun sitemap | bun scripts/generate_sitemap.ts --public ./src/public --dist ./dist | Generate sitemap.xml |
bun rss | bun scripts/generate_rss.ts --public ./src/public --dist ./dist | Generate RSS/JSON feeds from blog markdown |
Both should be run after bun ssg - they read from the generated dist/ directory. Neither command hardcodes a site URL; they read the absolute origin from the SITE_URL environment variable (see Configuration), so set SITE_URL in .env or the SSG environment before running them.
Sitemap Options
bun scripts/generate_sitemap.ts [options]
| Option | Default | Description |
|---|---|---|
--public <dir> | ./src/public | Source directory with page templates |
--dist <dir> | ./dist | Output directory (sitemap.xml is written here) |
--site-url <url> | $SITE_URL (required) | Absolute origin for <loc> and hreflang |
--help | - | Print usage and exit |
See the Sitemap Generator page for per-page frontmatter options.
RSS Options
bun scripts/generate_rss.ts [options]
| Option | Default | Description |
|---|---|---|
--public <dir> | ./src/public | Source directory |
--dist <dir> | ./dist | Output directory |
--site-url <url> | $SITE_URL (required) | Absolute origin |
--blog-dir <name> | $BLOG_DIR (required) | Sub-directory under --public to scan |
--formats <list> | xml,json | Comma list: xml, json, or both |
--max-items <n> | 50 | Limit items per feed |
--feed-title <text> | - | Override the feed title |
--feed-description <text> | - | Override the feed description |
--help | - | Print usage and exit |
See the RSS Generator page for per-post frontmatter options.
Installation
| Script | Command | Description |
|---|---|---|
bun reeweb:install | bun scripts/install.ts | Prepare an extracted ReeWeb project in the current directory |
The install task initialises Git, creates .env from .env.example when needed, runs bun install, and fetches ReeWeb's formatter and vendor assets. bun dev and bun ssg prepare images and build CSS when they run.
Publishing
| Script | Command | Description |
|---|---|---|
bun publisher | bun scripts/publisher.ts | Start the Publisher dashboard - watch git, render on demand, preview, deploy |
bun cf:deploy | wrangler deploy && … | Deploy dist/ to Cloudflare Workers and print the site URL |
bun publisher is the operations dashboard that re-renders and deploys the site
when content changes - manually, on a git commit, or on a signal from a paired
Reepolee app. Run bun publisher --render to force a render against an
already-running instance. The Deploy button (and any deploy flow) runs
bun cf:deploy under the hood. The full workflow and its PUBLISHER_*
configuration are documented on the Publisher
page.
Formatting
| Script | Command | Description |
|---|---|---|
bun format | reettier | Format all source files with reettier |
package.json Reference
The scripts above are defined in package.json under the "scripts" key. You can add your own scripts at any time - there's no ReeWeb-specific structure to follow:
{
"scripts": {
"dev": "bun scripts/dev/orchestrate.ts",
"development": "bun --hot --no-clear-screen scripts/dev.ts",
"dynamic:sync": "bun scripts/sync_dynamic_assets.ts",
"prepare:images": "bun scripts/prepare_images.ts",
"css:build": "tailwindcss -i ./src/css/style.css -o ./src/public/css/style.min.css --minify",
"css:watch": "tailwindcss -i ./src/css/style.css -o ./src/public/css/style.min.css --minify --watch=always",
"ssg": "bun run dynamic:sync && bun run prepare:images && bun css:build && bun scripts/ssg.ts --public ./src/public --dist ./dist && bun run og:images && bun run sitemap && bun run rss && bun run ssg:search",
"og:images": "bun scripts/generate_og_images.ts --dist ./dist",
"rss": "bun scripts/generate_rss.ts --public ./src/public --dist ./dist",
"sitemap": "bun scripts/generate_sitemap.ts --public ./src/public --dist ./dist",
"ssg:search": "bun scripts/generate_search_index.ts --public ./src/public --dist ./dist",
"format": "reettier",
"preview": "bun scripts/preview.ts",
"mcp": "bun scripts/mcp/index.ts",
"publisher": "bun scripts/publisher.ts",
"engine:check": "bun scripts/engine_drift_check.ts",
"get:pre": "bun get:zod && bun get:hljs && bun get:reettier && bun get:reesql && bun get:vips",
"reeweb:install": "bun get:pre && bun scripts/install.ts"
}
}