Runtime Comparison
How Flame runs on Bun, Node.js, and Deno — and what differs between them.
Flame is runtime-agnostic: the same CLI, the same output, on Bun, Node.js, or Deno. The runtime is only needed for the build toolchain and dev server — the final output is static HTML that deploys anywhere.
Runtime Detection
The CLI (flame) auto-detects the current runtime by checking process.execPath and global objects:
Override detection with the FLAME_RUNTIME environment variable:
This is useful for testing or CI environments where the runtime is ambiguous.
Command Dispatch
Each command maps to a runtime-specific entry point:
All runtime-specific entry points delegate to a shared implementation (build.impl.ts, preview.impl.ts, etc.) — only the HTTP server and client bundler differ per runtime.
Compile Lib Step
Bun executes TypeScript sources directly. Node.js and Deno cannot load JSX/TSX — they need precompiled JavaScript in .docu/lib/.
On first flame dev or flame build for a non-Bun runtime, the CLI runs compile-lib.mjs automatically:
In a published npm package, .docu/lib is included in the package. In a monorepo clone, it is gitignored and compiled lazily.
To trigger compilation manually:
Key Differences
Dev Server
Build
Deploy
The deploy command prepares .docu/dist for GitHub Pages:
- Bun: spawns
bun run buildas a subprocess, then writes.nojekyll+_headers. - Node / Deno: runs the build in-process via
build.impl.runBuildCli(), then writes.nojekyll.
Both generate a .github/workflows/deploy.yml if one does not exist. The generated workflow uses the appropriate setup action (oven-sh/setup-bun vs actions/setup-node).
Deno-Specific Notes
- Deno's
npm:specifier compatibility forreact-dom/serverresolves to the browser build (server.browser.js), which opens a module-scopeMessageChannel. After build, Flame callsprocess.exit(0)to force a clean exit. - The scaffolded
deno.jsonsetsnodeModulesDir: "auto"for npm compatibility. - First run may show a freshness warning. Bypass with
DENO_ALLOW_NEWER=true deno task dev.
When Each Runtime Shines
All three produce identical static output. The choice of runtime does not affect the deployed site.
Last updated Jul 11, 2026