tsdown
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 is a modern bundler built on Rolldown that streamlines the process of bundling TypeScript libraries for npm publication. To bundle your TypeScript library, you configure tsdown with your entry points and desired output formats (ESM, CJS, IIFE, or UMD), then run the build command. tsdown automatically handles TypeScript compilation, generates type declarations (.d.ts files), and optimizes your bundle with tree shaking and minification, making it straightforward to prepare your library for distribution.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-07-27
tsdown is a modern bundler built on Rolldown that streamlines the process of bundling TypeScript libraries for npm publication. To bundle your TypeScript library, you configure tsdown with your entry points and desired output formats (ESM, CJS, IIFE, or UMD), then run the build command. tsdown automatically handles TypeScript compilation, generates type declarations (.d.ts files), and optimizes your bundle with tree shaking and minification, making it straightforward to prepare your library for distribution.
Use it when
- tsdown is designed as a modern alternative to tsup, offering a streamlined experience for developers looking to migrate their build tooling.
- Yes, tsdown excels at generating type declarations and multi-format outputs.
Verify before relying
Read SKILL.md below before installing (41 files). Open directory: indexed for reading, not audited.
Install
rolldown/tsdown/tsdown · repository language: TypeScript
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 you bundle a TypeScript library with tsdown?
tsdown is a modern bundler built on Rolldown that streamlines the process of bundling TypeScript libraries for npm publication. To bundle your TypeScript library, you configure tsdown with your entry points and desired output formats (ESM, CJS, IIFE, or UMD), then run the build command. tsdown automatically handles TypeScript compilation, generates type declarations (.d.ts files), and optimizes your bundle with tree shaking and minification, making it straightforward to prepare your library for distribution.
What is the difference between tsdown vs tsup comparison?
tsdown is designed as a modern alternative to tsup, offering a streamlined experience for developers looking to migrate their build tooling. While both tools bundle TypeScript/JavaScript libraries for npm, tsdown is built on Rolldown for improved performance and provides a cleaner configuration approach. If you're considering a migration from tsup to tsdown, the tool is designed to require minimal configuration changes, allowing you to transition your existing projects with ease while gaining the benefits of faster build times and modern bundling capabilities.
Can tsdown generate type declarations and support multiple output formats?
Yes, tsdown excels at generating type declarations and multi-format outputs. The bundler automatically produces .d.ts declaration files alongside your compiled code and supports generating ESM, CJS, IIFE, and UMD formats in a single build. This comprehensive output capability makes tsdown ideal for publishing libraries to npm that need to support diverse consumption patterns, whether users are importing via ES modules, CommonJS, or browser-based IIFE/UMD bundles.
Is tsdown suitable for building React, Vue, Solid, or Svelte component libraries?
tsdown is well-suited for building component libraries across multiple frameworks including React, Vue, Solid, and Svelte. The bundler's support for generating multiple output formats, automatic type declaration generation, and tree shaking capabilities make it an excellent choice for component library authors. Whether you're creating a single-framework library or a framework-agnostic component collection, tsdown provides the bundling and optimization features needed to prepare your components for npm publication.
How does tsdown optimize bundle size with tree shaking and minification?
tsdown optimizes bundle size through built-in tree shaking and minification features that remove unused code and reduce file sizes automatically. By leveraging Rolldown's modern bundling engine, tsdown analyzes your code dependencies and eliminates dead code paths, then applies minification to further reduce the final bundle size. These optimizations happen transparently during the build process, ensuring your published npm packages are as lean and efficient as possible without requiring manual configuration.
What configuration is needed to set up tsdown for npm package publication?
tsdown is designed to require minimal configuration for npm package publication. You typically specify your entry points, desired output formats (ESM, CJS, IIFE, UMD), and any framework-specific settings if building component libraries. The bundler handles the rest automatically—including TypeScript compilation, type declaration generation, tree shaking, and minification. For developers migrating from tsup to tsdown, the configuration approach is streamlined to make the transition smooth while maintaining compatibility with your existing npm publishing workflows.
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/README.md
skills/tsdown/SKILL.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
skills/tsdown/references/option-cleaning.md
skills/tsdown/references/option-config-file.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 publication”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
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 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 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.
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.
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)