tsdown
Installation
Summary
Fast TypeScript/JavaScript library bundler powered by Rolldown with multi-format output and type declaration generation.
- Supports bundling to ESM, CJS, IIFE, and UMD formats with automatic peer dependency externalization and tree shaking
- Generates TypeScript declaration files (.d.ts) with source map and compiler option control, plus experimental CSS pipeline with preprocessor and PostCSS support
- Includes watch mode, minification, source maps, unbundle mode for preserving directory structure, and framework-specific recipes for React, Vue, Solid, and Svelte
- Offers CLI commands, programmatic API, lifecycle hooks, workspace/monorepo support, and direct Rolldown option passthrough for advanced customization
- Provides migration tooling from tsup and experimental features for standalone executable bundling and package validation (publint, attw)
SKILL.md
tsdown - The Elegant Library Bundler
Blazing-fast bundler for TypeScript/JavaScript libraries powered by Rolldown and Oxc.
Runtime Requirement
tsdown requires Node.js 22.18.0 or higher to run (build-time only). However, the bundled output can target much lower Node.js versions via the target option, so libraries built with tsdown are not locked to Node.js 22+ at runtime.
If your package needs to support Node.js 18 / 20:
- Build with Node.js 22+ in CI (e.g. set
target: 'node18'ortarget: 'node20'). - Test the built output (or the packed tarball) on the lower Node.js versions you intend to support — e.g. using a matrix job that runs the published package's tests on Node.js 18 / 20 / 22.