tsdown

Bundle TypeScript and JavaScript libraries into ESM, CJS, IIFE, and UMD outputs with automatic DTS generation.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/liangmiQwQ/skills --skill tsdown-liangmiqwq
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tsdown
Source: https://github.com/liangmiQwQ/skills/tree/main/skills/tsdown
Command: npx skills add https://github.com/liangmiQwQ/skills --skill tsdown-liangmiqwq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

tsdown streamlines building and distributing TypeScript/JavaScript libraries by providing a fast, opinionated bundler that handles multi-format outputs, DTS generation, and export mapping, plus monorepo support.

Core Features & Use Cases

  • Multi-format bundling: esm, cjs, iife, and umd outputs for versatile distribution.
  • Type declarations: automatic DTS generation and mapping.
  • Exports & workspace support: auto-generates package exports and works with monorepos.
  • Plugin ecosystem: seamless integration with Rolldown, Rollup, and Unplugin plugins.
  • Usage scenarios: library authors publishing packages, migrating from older tools like tsup.

Quick Start

Run tsdown to build your library using the default config or a custom config file.

Frequently Asked Questions about tsdown

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I bundle a TypeScript library into multiple formats like ESM and CJS?▼

To bundle a TypeScript library into ESM and CJS, you need a bundler that maps entry points to multi-format outputs. tsdown handles this by compiling TypeScript projects into versatile esm, cjs, iife, and umd distributions automatically.

What is the best way to generate type declarations for a JavaScript library during build?▼

Generating type declarations requires a build step that produces DTS files from your TypeScript source. tsdown provides automatic DTS generation and mapping, streamlining the process of publishing typed JavaScript libraries.

Can I use Rolldown or Rollup plugins when building a TypeScript workspace?▼

Yes, you can use Rolldown, Rollup, and Unplugin plugins when building a TypeScript workspace. tsdown supports a plugin ecosystem that allows seamless integration of these tools to customize your library's bundling process.

Does tsdown support monorepo architectures and automatic package exports?▼

tsdown supports monorepo architectures by applying workspace settings and auto-generating package exports. This ensures consistent publishing and correct module resolution across multiple packages in a single repository.

How do I migrate from tsup to another bundler for my TypeScript library?▼

Migrating from tsup involves mapping your existing configuration to a new bundler that handles multi-format outputs and DTS generation. tsdown is designed as a fast, opinionated alternative that streamlines this migration process.

Do I need a custom config file to bundle TypeScript libraries with automatic exports?▼

You need a TypeScript project with entry points and a tsdown config to bundle libraries with automatic exports. This config maps formats, targets, and workspace settings to ensure consistent publishing across your project.