tsup

Zero-config TypeScript library bundler powered by esbuild. tsup generates CJS and ESM builds from TypeScript source with type declarations — the standard tool for publishing TypeScript npm libraries. Single config (tsup.config.ts) handles multiple entry points, code splitting, external dependencies, sourcemaps, and declaration files. Produces properly-structured dual CJS/ESM packages for maximum ecosystem compatibility.

Evaluated Mar 06, 2026 (0d ago) v8+
Homepage ↗ Repo ↗ Developer Tools bundler typescript npm-library esbuild cjs esm tree-shaking
⚙ Agent Friendliness
67
/ 100
Can an agent use this?
🔒 Security
90
/ 100
Is it safe for agents?
⚡ Reliability
81
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
85
Error Messages
80
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
90
Auth Strength
90
Scope Granularity
90
Dep. Hygiene
88
Secret Handling
90

Local build tool — no security concerns. esbuild's Rust implementation is memory-safe. Published packages should be audited with npm audit after build.

⚡ Reliability

Uptime/SLA
85
Version Stability
82
Breaking Changes
78
Error Recovery
80
AF Security Reliability

Best When

You're publishing a TypeScript npm package and want CJS + ESM + .d.ts output with minimal configuration — tsup is the standard choice.

Avoid When

You're bundling an application (use Vite) or need complex Rollup plugin transformations. tsup is optimized for library publishing.

Use Cases

  • Bundle TypeScript npm libraries to publish CJS + ESM + type declarations with a single tsup command
  • Generate properly-structured dual-format npm packages (exports field) for maximum Node.js and bundler compatibility
  • Build TypeScript CLI tools that need a compiled, distributable npm package
  • Replace complex Rollup or webpack configurations for simple library bundling use cases
  • Build TypeScript SDKs and agents that publish to npm with correct module formats

Not For

  • Application bundling (React apps, Next.js) — use Vite, webpack, or framework CLIs for applications
  • Complex build pipelines with custom plugins beyond esbuild — Rollup has a richer plugin ecosystem for complex transforms
  • Non-TypeScript JavaScript libraries — tsup's primary value is TypeScript declaration generation

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
No
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

No authentication — local build tool.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT-licensed open source tool by Egoist.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • tsup uses esbuild for transpilation — complex TypeScript decorators (emitDecoratorMetadata) may not work correctly; use tsc for type declaration generation separately
  • Dual CJS+ESM builds require correct package.json 'exports' field configuration — missing exports field causes module resolution issues in consumers
  • External packages in 'dependencies' should be marked external in tsup config — forgetting this bundles dependencies into the output, inflating size
  • Type declarations generated by tsup use tsc under the hood — slow for large projects; skip declaration generation with --no-dts for development builds
  • tsup watch mode rebuilds on file changes but doesn't reload the consuming app — pair with nodemon or tsx watch in dependent apps
  • CSS and asset bundling is limited — tsup is optimized for TypeScript code; use Vite for assets/CSS bundling

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for tsup.

$99

Scores are editorial opinions as of 2026-03-06.

5209
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered