Skip to content

⚡️ Bundling your libraries done in a blink — powered by Bun 🍞

License

Notifications You must be signed in to change notification settings

arshad-yaseen/bunup

Repository files navigation

bunup

npm version npm downloads

An extremely fast, zero-config bundler for TypeScript & JavaScript, powered by Bun and Oxc.

Bundler Format Build Time Build Time (with dts)
bunup esm, cjs 3.13ms ⚡️ 19.43ms ⚡️
tsdown esm, cjs 5.89ms 43.76ms
unbuild esm, cjs 43.84ms 322.65ms
tsup esm, cjs 62.07ms 937.35ms

Lower build time is better. Benchmark run on the same code with identical output formats.

To run the benchmarks yourself, clone this repo and run pnpm benchmark and check results.md in the benchmarks folder.

See how fast it is:

demo.mov

🚀 Quick Start

Installations

# Using Bun
bun add bunup -d

# Using pnpm
pnpm add bunup -D

# Using npm
npm i bunup -D

# Using Yarn
yarn add bunup --dev

Basic Usage

Create a simple TypeScript file:

// src/index.ts
export function greet(name: string): string {
      return `Hello, ${name}!`;
}

Bundle it with bunup:

bunup src/index.ts

This will create a bundled output in the dist directory.

Using with package.json

Add a build script to your package.json:

{
      "name": "my-package",
      "scripts": {
            "build": "bunup src/index.ts --format esm,cjs --dts"
      }
}

Then run:

npm run build

⚙️ Configuration File

Create a bunup.config.ts file for more control:

import {defineConfig} from 'bunup';

export default defineConfig({
      entry: ['src/index.ts'],
      outDir: 'dist',
      format: ['esm', 'cjs'],
      dts: true,
      minify: true,
});

📚 Documentation

For complete documentation, visit the full documentation.

⚡️ Create TypeScript Libraries Faster

Quickly scaffold modern TypeScript library in 10 seconds. Powered by bunup.

# Using bun
bunx create-bunup@latest

# Using npm
npx create-bunup@latest

# Using pnpm
pnpx create-bunup@latest

Check out our TypeScript Library Starter documentation for more details.

❤️ Contributing

For guidelines on contributing, please read the contributing guide.

We welcome contributions from the community to enhance Bunup's capabilities and make it even more powerful.