1.6 KiB
1.6 KiB
Introduction
tsdown is The Elegant Library Bundler — a fast, simple bundler for TypeScript and JavaScript libraries powered by Rolldown (Rust-based).
Why tsdown?
Built on Rolldown, tsdown provides a complete out-of-the-box solution for library authors:
- Simplified Configuration: Sensible defaults for library development, minimal boilerplate
- Library-Specific Features: Auto TypeScript declarations, multiple output formats, package validation
- Future-Ready: Official Rolldown project, foundation for Rolldown Vite's Library Mode
Plugin Ecosystem
Supports the full Rolldown plugin ecosystem plus most Rollup plugins. See Plugins.
What Can It Bundle?
- TypeScript/JavaScript:
.ts,.jswith modern syntax - TypeScript Declarations: Auto-generate
.d.tsfiles - Multiple Formats:
esm,cjs,iife,umd - Assets:
.json,.wasm, CSS files - Built-in tree shaking, minification, and source maps
Key Differences from Rolldown
tsdown wraps Rolldown with library-specific features:
- Auto-external
dependencies,peerDependencies, andoptionalDependenciesfrompackage.json - DTS generation
package.jsonexports field generation- Watch mode with keyboard shortcuts
- CSS preprocessing pipeline
- Executable bundling (SEA)
Prior Arts
Inspired by: Rollup, esbuild, tsup, unbuild. Powered by Rolldown.
Related
- Getting Started - Installation and first build
- Migrate from tsup - Migration guide