Framework static exports
Bunfork accepts the finished browser directory. Pick MPA or SPA routing deliberately, write a strict manifest, verify it, then serve the same bytes.
Verified producers
| Producer | Output | Admission |
|---|---|---|
| Svelte + Vite | dist | SPA with fallback for client routing; otherwise MPA |
| Vue + Vite | dist | SPA with fallback for client routing; otherwise MPA |
| SvelteKit + adapter-static | build | MPA; SPA only with an explicit adapter fallback |
Next.js output: 'export' | out | MPA with directory trailing slashes recommended |
| Nuxt generate/prerender | .output/public | MPA, or explicit SPA for a client-only fallback export |
| Vite | dist | Match the application's actual router |
Build and admit in one command
bunfork build runs only the program and argv you provide, with a reduced environment, then admits the output. It performs no framework detection and refuses to pass Bunfork's key or API token variables to the build.
./target/release/bunfork build \
--run npm \
--arg run \
--arg build \
--cwd frontend \
--output dist \
--manifest bunfork-static.json \
--mode spa \
--fallback index.html \
--trailing-slash ignore
For SvelteKit use --output build --mode mpa. For Next use --output out --mode mpa --trailing-slash directory. For Nuxt, run its generate script and admit .output/public.
The manifest is the contract
The bunfork-static-v1 document records the route mode, base path, optional fallback, trailing-slash policy, precompression flag, and the SHA-256 digest plus byte length of every file.
{
"schema": "bunfork-static-v1",
"root": ".",
"mode": "mpa",
"base": "/",
"fallback": null,
"trailing_slash": "directory",
"precompressed": true,
"immutable": true,
"files": { "index.html": { "sha256": "…", "bytes": 1234 } }
}
Admission rejects symlinks, hard links, special files, hidden or sensitive paths, duplicate/unknown manifest fields, and unsafe URL structure. Serving re-hashes and preloads the artifact before the listener binds.
Static HTTP behavior
- Base paths, directory routes, and
.htmlexports - Explicit SPA fallback with asset and API exclusions
GET,HEAD,405, ETags, and304- Immutable caching for semantic SvelteKit
_app/immutable/and Next_next/static/namespaces; uncertain assets revalidate - Negotiated, admitted
.brand.gzsidecars