Static Sites
Build and deploy a static frontend using an ssg workspace or the lower-level frontend package CLI.
See also: CSS Playbook for the minimal, convention-first styling approach used by the SSG starter.
Supported Paths
- Top-level Bun CLI: scaffold an
ssgworkspace, or override a publish run withwebstir publish --workspace <path> --frontend-mode ssg. - Lower-level package CLI: run
webstir-frontend publish --workspace <path> --mode ssgwhen you are working directly with the frontend package.
Recommended Flow
webstir init ssg site
cd site
bun install
webstir publish --workspace "$PWD"
What happens:
- The frontend provider writes optimized assets to
dist/frontend/**. - SSG publish creates static-friendly aliases:
dist/frontend/pages/<page>/index.htmldist/frontend/<page>/index.htmldist/frontend/index.htmlwhenpages/home/index.htmlexists
- Publish injects the same optimized HTML/CSS/JS output used by the
ssgdemo workspaces.
Advanced Package-Level Flow
If you are testing the frontend package directly:
bunx webstir-frontend publish --workspace "$PWD" --mode ssg
Use this path when you need package-level control without going through the top-level orchestrator.
If you are using the top-level CLI against a non-ssg workspace, the equivalent override is webstir publish --workspace "$PWD" --frontend-mode ssg.
Static Paths from Module Metadata
You can describe SSG views in package.json under webstir.moduleManifest.views. SSG publish uses these hints to create additional index.html aliases and, when a backend view loader exists, generate per-page view-data.json.
Example:
{
"webstir": {
"mode": "ssg",
"moduleManifest": {
"views": [
{ "name": "HomeView", "path": "/" },
{ "name": "AboutView", "path": "/about" }
]
}
}
}
Notes:
routesmetadata is for backend APIs, not SSG page generation.- In
ssgworkspaces, omittedrenderModevalues default tossg. staticPathsis optional for simple views and useful when you want extra aliases such as/about/team.
GitHub Pages
webstir publish --workspace "$PWD"
mkdir -p out
cp -R dist/frontend/* out/
Then publish out/ with your preferred Pages workflow.
S3 + CloudFront
- Build the static frontend:
webstir publish --workspace "$PWD"
- Sync
dist/frontend/**to your bucket:
aws s3 sync dist/frontend "s3://your-bucket-name" --delete
- Configure your CDN to serve
index.htmlas the default object and cache hashed assets aggressively.