Built-in Bundler
Bun includes a fast JavaScript and TypeScript bundler. It can bundle your code for browsers, Node.js, or Bun itself without any configuration.
Basic Bundling
Bundle your code with a single command:
Loading Bun Playground...
Target Platforms
Bundle for different platforms:
Loading Bun Playground...
Output Formats
Control the output format:
Loading Bun Playground...
Code Splitting
Automatically split code for optimal loading:
Loading Bun Playground...
Plugins and Loaders
Extend the bundler with plugins:
Loading Bun Playground...
Minification
Optimize bundle size:
Loading Bun Playground...
Exercise: Build Command Generator
Create a function to generate build commands:
Loading Bun Exercise...
Exercise: Bundle Size Estimator
Create a function to estimate bundle size reduction:
Loading Bun Exercise...

