RuntimeActive

Bun Runtime

Bun Runtime: Runtime Package Manager Bundler Test Runner Guides Reference Blog Feedback Browse docs Runtime Get Started Welcome to Bun Installation Quickstart TypeScript TypeScript 6 and 7 bun init bun create Core Runtime Bun Runtime Watch Mode Debugging REPL bunfig.toml File & Module System File Types Module Resolution JSX Auto-install Plugins File System Router HTTP server Server Routing Cookies TLS Error Handling Metrics Networking Fetch WebSockets TCP UDP DNS Data & Storage Cookies File I/O

Open source page ↗

Field note

What it does

Runtime Package Manager Bundler Test Runner Guides Reference Blog Feedback Browse docs Bundler Core Bundler Development Server Fullstack dev server Hot reloading Asset Processing HTML & static sites Standalone HTML CSS Loaders Single File Executable Single-file executable Extensions Plugins Macros Optimization Bytecode Caching Minifier Migration esbuild Bundler › Core Copy page Bundler Bun&#x27;s fast native bundler for JavaScript, TypeScript, JSX, and more Use Bun&#x27;s native bundler through the bun build CLI command or the Bun.build() JavaScript API. At a Glance # JS API: await Bun.build({ entrypoints, outdir }) CLI: bun build <entry> --outdir ./out Watch: --watch for incremental rebuilds Targets: --target browser|bun|node Formats: --format esm|cjs|iife (experimental for cjs/iife) JavaScript CLI build.ts await Bun. build ({ entrypoints : [ ' ./index.tsx ' ], outdir : ' ./build ' , }); terminal bun build ./index.tsx --outdir ./build It&#x27;s fast. The following numbers are from esbuild&#x27;s three.js benchmark . Why bundle? # Bundlers solve several problems: Reducing HTTP requests. A single package in node_modules may consist of hundreds of files, and large applications may have dozens of such dependencies. Loading each of these files with a separate HTTP request becomes untenable, so bundlers convert your application source code into a smaller number of self-contained "bundles" that can be loaded with a single request.

Capabilities

Available capabilities

Tags

Tags

No tags filed yet.

Ways to use it

Ways to use it

No integrations filed yet.

Product features

Product features

API #

Assets #

At a Glance #

Basic example #

Bundle entirely from memory #

Bundler

Content types #

entrypoints #

files #

Plugins #

Watch mode #

Why bundle? #