SnapFire Compiler
Compile TypeScript for the browser without Node.js. It reads your sources, emits browser-native ES modules and stops if an import cannot be resolved. The binary is snapfirec.
No node_modules
Third-party libraries are committed to your repository and loaded through a browser import map. The build never downloads anything.
Import map checking
Pass --import-map and a bare import with no entry fails the build instead of failing in a browser tab.
One binary
It is a native binary built on SWC. You don't install a toolchain next to it and it doesn't need a configuration file.
Running a build
FSR runs this command for you. You can also run it yourself.
snapfirec --source-map --minify compact \
--public-path /static/js/app \
--import-map ../public/js/importmap.json| Flag | What it does |
|---|---|
--source-map | Writes a .map beside every output. |
--minify compact | Minifies without mangling what a stack trace needs. |
--public-path <prefix> | Sets the URL prefix the browser loads the outputs from. |
--import-map <file> | Fails the build when a bare import has no entry. |
How it relates to FSR
FSR uses the compiler to bundle an application's browser code. The compiler doesn't depend on FSR and knows nothing about plan files or routes, so you can use it on any TypeScript and CSS project, including one served by snapfire.