tsup

Zero-config TypeScript library bundler powered by esbuild

Tool
npm
v8.5.1
11,294stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
62/100Good
Development Activity36
Maintenance48
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture75
Code Quality72
Innovation70
Learning Curve85

tsup is a command-line bundler that packages TypeScript and JavaScript libraries with no configuration required. It wraps esbuild for the heavy lifting and layers on library-specific concerns esbuild doesn’t handle out of the box: multiple output formats (CJS, ESM, IIFE) in a single run, .d.ts declaration generation, code splitting, watch mode, and CLI entry bundling.

Because of its no-config defaults and speed, tsup became one of the most widely adopted ways to ship a TypeScript npm package, used by countless open-source libraries as their build step. The README now flags the project as no longer actively maintained, pointing users toward tsdown as a successor, but tsup remains in heavy production use (multi-million weekly npm downloads) and its GitHub issues/discussions stay active.

What You Get

  • Zero-config bundling driven entirely by CLI flags or an optional tsup.config.ts
  • Simultaneous CJS, ESM, and IIFE output from a single build invocation
  • Automatic .d.ts type declaration generation and rollup via API Extractor
  • Watch mode with process restart and on-save rebuilds for CLI development
  • Code splitting, tree-shaking, and shebang/CJS-interop handling for published packages

Common Use Cases

  • Bundling a TypeScript npm library into CJS + ESM before publishing
  • Building a Node.js CLI tool with a shebang-aware executable output
  • Generating rolled-up .d.ts type declarations alongside compiled JS
  • Watch-mode local development for a library consumed by another workspace package

Under The Hood

Architecture - The CLI entry (src/cli-main.ts, src/cli-default.ts) parses flags with cac, resolves an optional tsup.config.ts via bundle-require, then normalizes everything into NormalizedOptions inside src/index.ts. The core build() function fans out per-format esbuild runs coordinated through a PluginContainer (src/plugin.ts) that layers first-party esbuild plugins (shebang, cjs-splitting, swc-target, tree-shaking, size-reporter, terser) around the underlying esbuild calls in src/esbuild/, while a parallel path in src/tsc.ts/src/api-extractor.ts handles .d.ts generation and rollup outside the esbuild pipeline.

Tech Stack - Written in TypeScript targeting Node >=18, with esbuild ^0.27 as the bundling engine, Rollup ^4 used specifically for declaration-file rollup, chokidar/tinyglobby for watch and glob resolution, and optional peer dependencies (@swc/core, @microsoft/api-extractor, postcss, typescript) that unlock SWC transforms, API Extractor dts rollup, and PostCSS/Sass processing only when installed.

Code Quality - The test/ directory holds ten Vitest suites (index, css, dts, experimental-dts, svelte, graphql, shims, tsconfig, example) run via vitest run after a full build, covering most declared output modes; core modules use explicit TypeScript types (NormalizedOptions, Options) and a dedicated PrettyError/handleError path for user-facing failures, though inline code comments are sparse outside of edge-case explanations like the Windows taskkill handling in src/index.ts.

API Design - The public surface is deliberately small: a defineConfig() helper for config-file authors and CLI flags for everyone else, with sensible defaults (outDir: 'dist', CJS format) so a bare tsup src/index.ts produces a working build; the tradeoff is that discovering the full breadth of options (dts modes, splitting, multi-entry objects) requires consulting the external docs site rather than in-editor discovery, since most configuration is CLI-flag-driven rather than a single typed options object.

Used by 81 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

167

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
Python
66%
Apache 2.0

Agent Control

AI Agents

295

An open-source runtime control plane for AI agents — define safety guardrails once, apply them across agents built on LangChain, CrewAI, Google ADK, or AWS Strands, and update controls without redeploying code.

View details
79
Repo Health
71
Technical
70
Dependency
Built with
Python66%
TypeScript33%
Updated yesterday
Python
99%
MIT

Agent Lightning

AI Development

17,500

A Microsoft-built training framework that optimizes AI agents with reinforcement learning, automatic prompt optimization, or supervised fine-tuning — with near-zero code changes to your existing agent, in any framework.

View details
84
Repo Health
68
Technical
69
Dependency
Built with
Python99%
Updated today
TypeScript
97%
AGPL 3.0

Bigcapital

Invoicing Finance

3,846

Self-hostable double-entry accounting platform with invoicing, inventory, multi-currency, and real-time financial reporting for small and medium businesses.

View details
91
Repo Health
77
Technical
64
Dependency
Built with
TypeScript97%
Updated yesterday
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

10,880

A self-hosted, AI-powered card note-taking tool that lets you capture fleeting thoughts instantly and retrieve them with natural language search.

View details
83
Repo Health
69
Technical
65
Dependency
Built with
TypeScript92%
Updated 2 weeks ago
TypeScript
100%
MIT

Botpress

AI Assistants · AI Development · Customer Support

14,872

The open-source hub for building and deploying LLM-powered AI agents with TypeScript-first tooling, 40+ integrations, and a revolutionary code-execution agent framework.

View details
95
Repo Health
82
Technical
66
Dependency
Built with
TypeScript100%
Updated yesterday
TypeScript
99%
Apache 2.0

Bubble Lab

Automation · AI Development

1,095

Open-core workflow engine for building AI-powered automations in TypeScript that run natively inside Slack — no context switching required.

View details
35
Repo Health
78
Technical
72
Dependency
Built with
TypeScript99%
Updated 3 months ago
TypeScript
55%
Other

Cap

Team Chat · Video Conferencing

20,986

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
65
Dependency
Built with
TypeScript55%
Rust40%
Updated yesterday
JavaScript
50%
Apache 2.0

claude-mem

AI Agents · AI Development

91,197

Give your AI coding agents persistent memory — claude-mem captures everything that happens during sessions, compresses it with AI, and surfaces the right context in every future session automatically.

View details
86
Repo Health
82
Technical
77
Dependency
Built with
JavaScript50%
TypeScript48%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search