bun-bundle is a lightweight module bundler that wraps Bun.build, providing a simplified API for bundling JavaScript and TypeScript projects. As of version 4.0.3 (released in late 2024), it supports ESM output, HTML entrypoints, and conditional entry naming. Compared to Bun's native build API, bun-bundle offers a less opinionated configuration and automatic handling of common patterns. It is actively maintained with frequent releases, focusing on simplicity and ease of use for projects targeting Bun runtime.
npm install bun-bundleVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of the bundle function with common options: entrypoints, output directory, target, format, and minification.
Update your code to use the new flat configuration object. Refer to the v3 migration guide.
If you were using implicit JS entrypoints, migrate to explicit entrypoints in your configuration.
Ensure you run your script with Bun (e.g., bun run build.js). Do not use node.
Set target: 'bun' in your configuration.
Run 'bun install bun-bundle' (or 'npm install') and use ESM imports (import ... from 'bun-bundle').
Change 'import bundle from' to 'import { bundle } from'.Use 'BunBundleConfig' instead.