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.
Scaffold
Spin up a modern, ready-to-publish TypeScript or React component library (or a basic starter) in ~10 seconds:
bunx @bunup/cli@latest createSee more in Scaffold with Bunup.
Quick Start
Create a TypeScript file:
export function greet(name: string): string {
return `Hello, ${name}!`;
}Build it instantly:
bunx bunupOutputs to dist/ with ESM and .d.ts types.
Need CommonJS too?
bunx bunup --format esm,cjsWant to generate and sync package exports automatically?
bunx bunup --exportsUsing with package.json
First, install Bunup as a dev dependency:
bun add --dev bunupAdd a build script to your package.json:
{
"name": "my-package",
"scripts": {
"build": "bunup"
}
}Then run:
bun run buildDefault 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:
bunx bunup src/index.ts src/plugins.tsSee Entry Points for details.
Watch Mode
Bunup can watch files for changes and rebuild automatically:
bunx bunup --watchOr configure it in package.json:
{
"name": "my-package",
"scripts": {
"build": "bunup",
"dev": "bunup --watch"
}
}Then run:
bun run devConfig 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.