tsdown

Bundle TypeScript and JavaScript libraries into ESM, CJS, IIFE, and UMD formats with type declarations.

Updated Dec 10, 2025
One-click install
npx skills add https://github.com/will-lol/diagram-creator --skill tsdown-will-lol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsdown
Source: https://github.com/will-lol/diagram-creator/tree/main/packages/typst-wasm/.agents/skills/tsdown
Command: npx skills add https://github.com/will-lol/diagram-creator --skill tsdown-will-lol

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Tsdown eliminates slow, fragile, or manually-configured bundling workflows by providing a fast, opinionated bundler that produces consistent distributable outputs and type declarations for library projects.

Core Features & Use Cases

  • Multi-format builds: Build ESM, CJS, IIFE, and UMD outputs from a single configuration.
  • Type declaration generation: Produce and bundle .d.ts files using fast oxc-transform or a tsc fallback.
  • Plugin and framework support: Use Rolldown, Rollup, Unplugin, and framework recipes for React, Vue, Solid, Svelte, and WASM.
  • CI & monorepo workflows: CI-aware options, publint/attw validations, workspace support, and fail-on-warn controls for reliable releases.
  • Developer DX: Watch mode, unbundle mode, lifecycle hooks, programmatic API, and migration tools for tsup users.

Quick Start

Run npx tsdown in your project root to produce ESM and CJS bundles with type declarations.

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?

You can bundle a TypeScript library into ESM, CJS, IIFE, and UMD formats from a single configuration using tsdown. Run `npx tsdown` in your project root to generate multi-format bundles.

What's the best way to generate .d.ts type declarations for a TypeScript library?

To generate .d.ts type declarations for a TypeScript library, tsdown produces and bundles .d.ts files using fast oxc-transform or a tsc fallback. This eliminates slow, manually-configured declaration generation.

Does tsdown support CI pipelines and monorepo workflows for library releases?

Tsdown supports CI pipelines and monorepo workflows by providing CI-aware options, workspace support, publint/attw validations, and fail-on-warn controls to ensure reliable library releases.

Can I use Rolldown or Unplugin plugins when bundling JavaScript libraries?

You can use Rolldown, Rollup, and Unplugin plugins when bundling JavaScript libraries with tsdown. It also offers framework recipes for React, Vue, Solid, Svelte, and WASM integrations.

How do I migrate from tsup to a faster TypeScript bundler?

You can migrate from tsup to a faster TypeScript bundler using tsdown's built-in migration tools. It provides a blazing-fast, opinionated configuration that produces consistent distributable outputs and type declarations.

Why is my TypeScript library build slow and how can I watch for changes during development?

Slow TypeScript library builds can be replaced with tsdown's blazing-fast bundling, which also includes a watch mode and unbundle mode to streamline development and lifecycle hook management.