Documentation menu

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

ProducerOutputAdmission
Svelte + VitedistSPA with fallback for client routing; otherwise MPA
Vue + VitedistSPA with fallback for client routing; otherwise MPA
SvelteKit + adapter-staticbuildMPA; SPA only with an explicit adapter fallback
Next.js output: 'export'outMPA with directory trailing slashes recommended
Nuxt generate/prerender.output/publicMPA, or explicit SPA for a client-only fallback export
VitedistMatch 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 .html exports
  • Explicit SPA fallback with asset and API exclusions
  • GET, HEAD, 405, ETags, and 304
  • Immutable caching for semantic SvelteKit _app/immutable/ and Next _next/static/ namespaces; uncertain assets revalidate
  • Negotiated, admitted .br and .gz sidecars