Skip to content

Latest commit

 

History

History
82 lines (59 loc) · 2.56 KB

File metadata and controls

82 lines (59 loc) · 2.56 KB

biu — Usage Guide

A zero-config, high-performance bundler for HTML + TypeScript/JavaScript, powered by Bun.

Quick Start

# Place `biu` in your PATH, then from any project directory:
biu                        # Build ./src → ./dist
biu ./src ./dist           # Explicit source & output dirs
biu --serve 3000           # Dev server with live reload

Command Syntax

biu [options] [srcDir] [outDir]
Argument Default Description
srcDir ./src Source directory
outDir ./dist Output directory

Options

Option Description
--watch Watch mode — rebuild on file changes
--static <dir> Static assets directory (default: ./static)
--post-build <file> Run .sh/.ts/.js script after each build
--serve [port] Start dev server (default port: 3000, implies --watch)
--build [outfile] Self-compile to standalone binary (default: ./biu)
-v, --version Show version
-h, --help Show help

Options can appear in any order.

Examples

Basic build:

biu ./src ./dist

Watch mode with dev server:

biu --serve 8080

Custom static directory + post-build script:

biu --static ./public --post-build ./scripts/deploy.sh

Smart Module Splitting

  • Independent module: If a .ts/.js file's basename (e.g. main.ts) appears in any HTML file, it's built as a separate module with content hash.
  • Auto inline: If the basename never appears in any HTML, the file is automatically inlined into its importer — no separate output.
  • Force inline (??): Append ?? to force inline bundling:
    import { myUtil } from "./utils.ts??";

Environment Variables

Variable Description
BIU_ASSETS_EXTS Extra asset extensions, e.g. "glb,gltf,hdr"
BIU_EXCLUDED Regex pattern to exclude files, e.g. "test|spec"

More Information

Full documentation: https://github.com/mindon/biu

License: MIT — https://github.com/mindon/biu/blob/main/LICENSE