Skip to content

Introduction

Bunup is the blazing-fast build tool for TypeScript libraries, designed for flawless developer experience and speed, powered by Bun.

Performance

Instant builds by design even with type declarations. With Bun’s native speed, builds and rebuilds are extremely quick, even in monorepos. Faster feedback loops, higher productivity, calmer flow. See benchmarks.

ToolBuild Time (s)Relative Speed
bunup0.37 sbaseline
tsdown0.41 s1.11× slower
rslib1.41 s3.81× slower
unbuild3.19 s8.62× slower
tsup3.37 s9.11× slower

Scaffold

Spin up a modern, ready-to-publish TypeScript or React component library (or a basic starter) in ~10 seconds:

sh
bunx @bunup/cli@latest create

See more in Scaffold with Bunup.

Quick Start

Create a TypeScript file:

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

Build it instantly:

sh
bunx bunup

Outputs to dist/ with ESM and .d.ts types.

Need CommonJS too?

sh
bunx bunup --format esm,cjs

Want to generate and sync package exports automatically?

sh
bunx bunup --exports

Using with package.json

First, install Bunup as a dev dependency:

sh
bun add --dev bunup

Add a build script to your package.json:

package.json
json
{
  "name": "my-package",
  "scripts": {
    "build": "bunup"
  }
}

Then run:

sh
bun run build

Default Entry Points

Bunup automatically detects common entry points.

index.ts, index.tsx, src/index.ts, src/index.tsx, cli.ts, src/cli.ts, src/cli/index.ts

This is why simply running bunx bunup works out of the box.

For example, if your project has both src/index.ts and src/cli.ts, Bunup will build both automatically.

To override the default entry points or specify exactly which files to build, list them explicitly:

sh
bunx bunup src/index.ts src/plugins.ts

See Entry Points for details.

Watch Mode

Bunup can watch files for changes and rebuild automatically:

sh
bunx bunup --watch

Or configure it in package.json:

package.json
json
{
  "name": "my-package",
  "scripts": {
    "build": "bunup",
    "dev": "bunup --watch"
  }
}

Then run:

sh
bun run dev

Config File

While most options can be set directly via the CLI, and the CLI works well on its own, in some cases you will need to use a configuration file. This is useful when you want to use plugins, leverage Bunup workspaces, target multiple environments with different configurations, or simply centralize your build settings.

See Config File for details and Options for all the available build options with side-by-side configuration and CLI examples.

Released under the MIT License.