bun-build
Installation
SKILL.md
Bun Production Build Configuration
Set up production builds using Bun's native bundler — fast, optimized bundle creation without webpack or esbuild.
What's new in Bun 1.4
- Standalone executables:
Bun.build({ compile: true })compiles to a standalone binary (1.3.10) - Self-contained HTML:
--target=browserproduces a self-contained HTML file (1.3.10) - Bundle analysis as Markdown:
--metafile-mdwrites LLM-friendly bundle analysis (1.3.8) - Bytecode compilation:
--compile --bytecodefor cross-compilation (1.4.1) - Tree-shaking via dynamic import: dynamic
import()now participates in tree-shaking - Barrel import optimization: re-export chains are optimized automatically
- Virtual filesystem:
Bun.build({ files })injects virtual files into the bundle - Smaller/faster compiled executables: up to 17% smaller binaries, faster startup