Skip to content

Bundling your TypeScript libraries has never been faster ⚡️ thanks to 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 Relative Speed
bunup esm, cjs 6ms ⚡️ 9.7x faster
bunup (+ dts) esm, cjs 32ms ⚡️ 25.8x faster
tsdown esm, cjs 22ms 2.6x faster
tsdown (+ dts) esm, cjs 52ms 15.9x faster
tsup esm, cjs 58ms baseline
tsup (+ dts) esm, cjs 825ms baseline

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

🚀 Quick Start

Installation

# 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.

❤️ 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.

About

Bundling your TypeScript libraries has never been faster ⚡️ thanks to Bun.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published