Compile one or more TypeScript files with banira's compiler defaults.
| Argument | Description |
|---|---|
<files...> | TypeScript files to compile. |
| Option | Description |
|---|---|
-p, --project <path> | Path to a tsconfig.json whose options override the defaults. |
-o, --output <path> | Directory to write the emitted JavaScript to. |
--import-map [path] | Also emit an import map (esm.sh) for the components’ bare imports; optional output path. |
--optimize-css | Run inlined CSS through lightningcss (lower nesting, minify). Optional dependency. |
--no-source-map | Do not emit source maps (which embed the original TypeScript). |
$ banira compile src/my-button.ts -o dist$ banira compile src/my-button.ts -o dist --import-mapUses Compiler.DEFAULT_COMPILER_OPTIONS unless you pass your own via --project.
The underlying Compiler is also available as a library export. Each .js ships a
.js.map (original TypeScript embedded) by default — pass --no-source-map for production builds.
With --import-map, bare imports resolve in the browser from esm.sh with no bundler.