# tsup

> Bundle your TypeScript library with no config, powered by esbuild

Latest version **8.5.1** (published 2025-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install tsup
pnpm add tsup
yarn add tsup
bun add tsup
```

Provides the commands `tsup`, `tsup-node`.

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; no vulnerabilities; has provenance; high maintenance score; high quality score; popular repo.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 8.5.1 |
| Published | 2025-11-12 |
| First published | 2020-05-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 17 |
| Unpacked size | 380.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 11295 |
| Author | EGOIST |
| Maintainers | egoist, sxzz |

## Links

- npm: https://www.npmjs.com/package/tsup
- Repository: https://github.com/egoist/tsup
- Homepage: https://tsup.egoist.dev/
- Issues: https://github.com/egoist/tsup/issues
- npm.io page: https://npm.io/package/tsup

## Dependencies (17)

- [cac](https://npm.io/package/cac.md) ^6.7.14
- [debug](https://npm.io/package/debug.md) ^4.4.0
- [joycon](https://npm.io/package/joycon.md) ^3.1.1
- [rollup](https://npm.io/package/rollup.md) ^4.34.8
- [consola](https://npm.io/package/consola.md) ^3.4.0
- [esbuild](https://npm.io/package/esbuild.md) ^0.27.0
- [sucrase](https://npm.io/package/sucrase.md) ^3.35.0
- [chokidar](https://npm.io/package/chokidar.md) ^4.0.3
- [tinyexec](https://npm.io/package/tinyexec.md) ^0.3.2
- [tree-kill](https://npm.io/package/tree-kill.md) ^1.2.2
- [picocolors](https://npm.io/package/picocolors.md) ^1.1.1
- [source-map](https://npm.io/package/source-map.md) ^0.7.6
- [tinyglobby](https://npm.io/package/tinyglobby.md) ^0.2.11
- [resolve-from](https://npm.io/package/resolve-from.md) ^5.0.0
- [bundle-require](https://npm.io/package/bundle-require.md) ^5.1.0
- [postcss-load-config](https://npm.io/package/postcss-load-config.md) ^6.0.1
- [fix-dts-default-cjs-exports](https://npm.io/package/fix-dts-default-cjs-exports.md) ^1.0.0

## Recent versions

- 8.5.1 (latest) — 2025-11-12
- 8.5.0 — 2025-05-16
- 8.4.0 — 2025-02-25
- 8.3.6 — 2025-01-25
- 8.3.5 — 2024-10-26
- 8.3.4 — 2024-10-25
- 8.3.0 — 2024-09-17
- 8.2.4 — 2024-08-02
- 8.2.3 — 2024-07-24
- 8.2.2 — 2024-07-22
- 8.2.1 — 2024-07-20
- 8.2.0 — 2024-07-19
- 8.1.2 — 2024-07-17
- 8.1.1 — 2024-07-16
- 8.1.0 — 2024-06-03
- … 189 more at https://npm.io/package/tsup/versions

## README

> [!WARNING]
> This project is not actively maintained anymore. Please consider using [tsdown](https://github.com/rolldown/tsdown/) instead. Read more in [the migration guide](https://tsdown.dev/guide/migrate-from-tsup).

# tsup

[![npm version](https://badgen.net/npm/v/tsup)](https://npm.im/tsup) [![npm downloads](https://badgen.net/npm/dm/tsup)](https://npm.im/tsup)

Bundle your TypeScript library with no config, powered by [esbuild](https://github.com/evanw/esbuild).

## 👀 What can it bundle?

Anything that's supported by Node.js natively, namely `.js`, `.json`, `.mjs`. And TypeScript `.ts`, `.tsx`. [CSS support is experimental](https://tsup.egoist.dev/#css-support).

## ⚙️ Install

Install it locally in your project folder:

```bash
npm i tsup -D
# Or Yarn
yarn add tsup --dev
# Or pnpm
pnpm add tsup -D
```

You can also install it globally but it's not recommended.

## 📖 Usage

### Bundle files

```bash
tsup [...files]
```

Files are written into `./dist`.

You can bundle multiple files in one go:

```bash
tsup src/index.ts src/cli.ts
```

This will output `dist/index.js` and `dist/cli.js`.

## 📚 Documentation

For complete usages, please dive into the [docs](https://tsup.egoist.dev).

For all configuration options, please see [the API docs](https://jsdocs.io/package/tsup).

## 💬 Discussions

Head over to the [discussions](https://github.com/egoist/tsup/discussions) to share your ideas.

## Sponsors

<p align="center">
  <a href="https://chromatic.com" target="_blank"><picture>
  <source media="(prefers-color-scheme: dark)" width="500" srcset="https://fastly.jsdelivr.net/gh/egoist-bot/images@main/uPic/Group 2 (2).png">
  <img alt="Ship UIs faster with automated workflows for Storybook"  width="500" src="https://fastly.jsdelivr.net/gh/egoist-bot/images@main/uPic/Group%202%20(1).png">
</picture></a>
</p>

<p align="center">
<a href="https://github.com/sponsors/egoist" target="_blank"><img src="https://sponsors-images.egoist.dev/sponsors.svg" alt="sponsors"></a>
</p>

## Project Stats

![Alt](https://repobeats.axiom.co/api/embed/4ef361ec8445b33c2dab451e1d23784015834c72.svg 'Repobeats analytics image')

## License

MIT &copy; [EGOIST](https://github.com/sponsors/egoist)

---
_Source: https://npm.io/package/tsup · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
