mirror of
https://github.com/oven-sh/bun
synced 2026-02-19 07:12:24 +00:00
## Summary - Adds self-contained HTML output mode: `--compile --target=browser` (CLI) or `compile: true, target: "browser"` (`Bun.build()` API) - Produces HTML files with all JS, CSS, and assets inlined directly: `<script src="...">` → inline `<script>`, `<link rel="stylesheet">` → inline `<style>`, asset references → `data:` URIs - All entrypoints must be `.html` files when using `--compile --target=browser` - Validates: errors if any entrypoints aren't HTML, or if `--splitting` is used - Useful for distributing `.html` files that work via `file://` URLs without needing a web server or worrying about CORS restrictions ## Test plan - [x] Added `test/bundler/standalone.test.ts` covering: - Basic JS inlining into HTML - CSS inlining into HTML - Combined JS + CSS inlining - Asset inlining as data URIs - CSS `url()` references inlined as data URIs - Validation: non-HTML entrypoints rejected - Validation: mixed HTML/non-HTML entrypoints rejected - Validation: splitting rejected - `Bun.build()` API with `compile: true, target: "browser"` - CLI `--compile --target=browser` - Minification works with compile+browser 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>