tsdown
tsdown is a bundling tool designed to package TypeScript and JavaScript libraries for npm distribution with support for multiple output formats. It simplifies the build process by offering flexible configuration options tailored to modern web development workflows.
tsdown is a bundling tool that packages TypeScript and JavaScript libraries for npm distribution with support for multiple output formats. To bundle your TypeScript library with tsdown, you configure it to generate the desired output formats (such as ESM and CommonJS), and tsdown handles the compilation and bundling process automatically. The tool simplifies the build workflow by offering flexible configuration options tailored to modern web development needs.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-06-10
tsdown is a bundling tool that packages TypeScript and JavaScript libraries for npm distribution with support for multiple output formats. To bundle your TypeScript library with tsdown, you configure it to generate the desired output formats (such as ESM and CommonJS), and tsdown handles the compilation and bundling process automatically. The tool simplifies the build workflow by offering flexible configuration options tailored to modern web development needs.
Use it when
- tsdown is designed as a modern alternative to tsup for bundling TypeScript libraries.
- Yes, tsdown supports generating type declarations (DTS files) as part of its bundling process.
Verify before relying
Read SKILL.md below before installing (42 files). Open directory: indexed for reading, not audited.
Install
hairyf/skills/tsdown · repository language: MDX
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I bundle a TypeScript library with tsdown?
tsdown is a bundling tool that packages TypeScript and JavaScript libraries for npm distribution with support for multiple output formats. To bundle your TypeScript library with tsdown, you configure it to generate the desired output formats (such as ESM and CommonJS), and tsdown handles the compilation and bundling process automatically. The tool simplifies the build workflow by offering flexible configuration options tailored to modern web development needs.
What is the tsdown vs tsup comparison?
tsdown is designed as a modern alternative to tsup for bundling TypeScript libraries. While both tools serve similar purposes in packaging libraries for npm, tsdown offers a streamlined approach with its own set of configuration options and build optimizations. If you're considering a migration from tsup, tsdown provides a path forward with minimal configuration changes required to adapt your existing build setup.
Can tsdown generate type declarations and optimize bundles with tree shaking?
Yes, tsdown supports generating type declarations (DTS files) as part of its bundling process, ensuring your published library includes proper TypeScript support. The tool also incorporates tree shaking and minification capabilities to optimize your bundles, reducing the final package size and improving performance for consumers of your library.
Does tsdown support bundling React, Vue, Solid, or Svelte component libraries?
tsdown is well-suited for building component libraries across multiple frameworks including React, Vue, Solid, and Svelte. Its flexible configuration and support for multiple output formats make it an effective choice for packaging framework-specific component libraries for npm distribution.
How do I migrate from tsup to tsdown?
tsdown is designed to facilitate migration from tsup with minimal configuration changes required. The tool maintains compatibility with common build patterns and configuration approaches, allowing you to transition your existing tsup-based projects to tsdown without extensive rework of your build setup.
Can tsdown create standalone executables or CLI tools?
tsdown supports bundling for standalone executables and CLI tools, though this represents a secondary use case compared to its primary focus on bundling TypeScript and JavaScript libraries for npm. The tool's bundling capabilities can be leveraged to package command-line applications and executable programs alongside traditional library distributions.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
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.
When to Use
- Building TypeScript/JavaScript libraries for npm
- Generating TypeScript declaration files (.d.ts)
- Bundling for multiple formats (ESM, CJS, IIFE, UMD)
- Optimizing bundles with tree
(truncated - see the full file via the links below)
File tree — 15 files
skills/tsdown/LICENSE.md
skills/tsdown/README.md
skills/tsdown/SKILL.md
skills/tsdown/SYNC.md
skills/tsdown/references/README.md
skills/tsdown/references/advanced-benchmark.md
skills/tsdown/references/advanced-ci.md
skills/tsdown/references/advanced-hooks.md
skills/tsdown/references/advanced-plugins.md
skills/tsdown/references/advanced-programmatic.md
skills/tsdown/references/advanced-rolldown-options.md
skills/tsdown/references/guide-getting-started.md
skills/tsdown/references/guide-introduction.md
skills/tsdown/references/guide-migrate-from-tsup.md
skills/tsdown/references/option-cjs-default.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Bundle TypeScript/JavaScript libraries for npm with multiple output formats”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
tsdown is a modern bundler built on Rolldown that streamlines packaging TypeScript and JavaScript libraries for distribution. It combines fast build performance with automatic declaration file generation, making it ideal for developers preparing libraries for npm publication.
tsdown packages your TypeScript and JavaScript code for npm distribution while preserving complete type information. This skill automates the bundling process, ensuring your libraries ship with accurate type declarations for better developer experience and IDE support.
tsdown handles the complexities of preparing TypeScript and JavaScript packages for npm distribution across multiple module formats. It automates bundling, format generation, and output optimization so you can focus on writing code rather than build configuration.
Ts Sdk Author provides a robust framework for building and organizing TypeScript SDKs from the ground up. This agent harness accelerates SDK scaffolding, letting you focus on implementation details rather than boilerplate setup. Ideal for developers who need production-ready TypeScript SDK foundations quickly.
Tsdown streamlines the process of acquiring TypeScript files on demand, giving developers a straightforward way to handle remote file retrieval in their workflows. Whether you're building automation scripts or managing dependencies, this tool integrates seamlessly into your development pipeline.
This skill guides you through converting an existing tsup-based build setup to tsdown, Rolldown's elegant library bundler. It provides comprehensive option mappings and automated config transformation to ensure your project transitions smoothly while maintaining build performance and output quality.
More skills Ts Library (unlicensed) · arch-tsdown (MIT) · arch-tsdown-monorepo (MIT) · Tanstack Cli (unlicensed) · antfu (MIT) · monorepo-management (MIT) · turborepo (MIT)