tsdown

Bundle TypeScript libraries into ESM, CJS, IIFE, and UMD formats.

28|6|Updated Aug 25, 2022
One-click install
npx skills add https://github.com/sanity-io/pkg-utils --skill tsdown-sanity-io
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsdown
Source: https://github.com/sanity-io/pkg-utils/tree/main/.agents/skills/tsdown
Command: npx skills add https://github.com/sanity-io/pkg-utils --skill tsdown-sanity-io

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Tsdown bundles TypeScript libraries and generates type declarations to streamline distribution.

Core Features & Use Cases

  • Fast, multi-format bundling for TypeScript libraries (esm, cjs, iife, umd)
  • Automatic .d.ts generation and export management
  • Easy migration path for projects moving from tsup or esbuild

Quick Start

Create a tsdown.config.ts with your entry points and enable dts and exports, then run the tsdown CLI to build and generate exports and 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 and generate type declarations?

Tsdown bundles TypeScript libraries and generates type declarations by processing configuration-driven entry points to output multi-format packages with automatic .d.ts generation.

Can I output multiple formats like ESM and CJS from a single TypeScript build?

Yes, you can output multiple formats from a single TypeScript build. Tsdown supports generating ESM, CJS, IIFE, and UMD formats simultaneously while managing automatic exports for your package.

How do I migrate from tsup or esbuild to a Rolldown-based bundler?

Migrating to a Rolldown-based bundler is supported through tsdown, which offers an easy migration path for projects moving from tsup or esbuild while integrating with the Rollup ecosystem.

What is the best way to configure multi-format exports for a TypeScript package?

The best way to configure multi-format exports is using a configuration-driven workflow with tsdown, which automatically manages package exports and entry-point configurations across ESM and CJS outputs.

Does tsdown support watch mode and unbundle modes for TypeScript development?

Yes, tsdown supports optional watch mode for continuous development and unbundle modes for TypeScript library distribution, enforcing a configuration-driven workflow integrated with Rolldown.