Bytecode
ff compile turns an ES module into QuickJS bytecode (.ffbc) with source and debug info stripped. Run the result with plain ff — the loader detects the .ffbc magic.
Quick look
Compiling
Rules:
- Input must be an ES module; a syntax error prints
compile error in '<path>'and writes nothing. - Input cap is 20MB — larger files fail.
- Output embeds bytecode only: no source text, no debug info. Stack traces from
.ffbcwon't show original line names.
Running bytecode
No flag needed — ff sniffs the file magic and loads bytecode instead of source. Everything else behaves identically: ff test-style harnesses, FF_ECHO, TLS flags, and env vars all work the same.
Note:
ff testignores.ffbcfiles (it only runs*.test.js). Keep the.jssources for your test suite and compile only what you ship.
Practical example: ship a server without source
Deploy main.ffbc (+ ff.json if you use ff start semantics elsewhere) instead of main.js. Recipients get a working binary artifact with no readable source.
When to use it (and when not to)
Troubleshooting
compile error in 'x.js' — the module has a syntax error. Run it first with ff x.js to see the real parse error, fix, recompile.
Output missing after compile — check the printed path (Compiled a -> b (N bytes)); with -o a typo'd directory fails the write. Create the dir first.
Stack traces look stripped — expected. Bytecode drops source + debug info by design; reproduce against the .js for real traces.
Test runner ignores my .ffbc — by design. ff test only loads *.test.js; keep sources alongside artifacts.
