tsdown

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

5|Updated Dec 15, 2025
One-click install
npx skills add https://github.com/octoplorer/statocysts --skill tsdown-octoplorer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsdown
Source: https://github.com/octoplorer/statocysts/tree/main/.agents/skills/tsdown
Command: npx skills add https://github.com/octoplorer/statocysts --skill tsdown-octoplorer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines bundling TypeScript and JavaScript libraries, enabling multiple output formats, automatic type declaration generation, and a smoother migration path from older tools.

Core Features & Use Cases

  • Multi-format Bundling: Produce ESM, CJS, IIFE, and UMD bundles from a single config.
  • Type Declarations: Generate and bundle .d.ts files for library consumers.
  • Monorepo Ready: Works with workspace patterns and package-level builds.

Quick Start

Install tsdown, create a config with defineConfig, and run the CLI to build libraries. For example: defineConfig({ entry: ['src/index.ts'], format: ['esm','cjs'], dts: true }).

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 for multiple output formats?

Bundling a TypeScript library for multiple formats requires a config-driven workflow that compiles source code into ESM, CJS, IIFE, and UMD outputs from a single configuration file.

How do I generate TypeScript declaration files for library consumers?

Generating TypeScript declaration files for library consumers is handled through optional DTS support, which automatically produces and bundles .d.ts files during the library build process.

What is the best way to migrate a TypeScript library from tsup?

Migrating a TypeScript library from tsup involves switching to a Rolldown-based bundling workflow, leveraging a config-driven approach to retain multi-format output and type declaration capabilities.

Does Rolldown-based bundling work for monorepo workspace builds?

Rolldown-based bundling supports monorepo workspace builds by using workspace patterns to execute package-level builds, enabling multi-format distribution across multiple packages.

Do I need Node.js to bundle TypeScript libraries with tsdown?

Bundling TypeScript libraries with tsdown requires Node.js installed in the project environment, along with the tsdown package added as a dependency to execute the CLI and config workflow.