tsdown

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

3|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/joknoll/svelte-attach-key --skill tsdown-joknoll
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsdown
Source: https://github.com/joknoll/svelte-attach-key/tree/main/.agents/skills/tsdown
Command: npx skills add https://github.com/joknoll/svelte-attach-key --skill tsdown-joknoll

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of bundling TypeScript and JavaScript libraries, offering exceptional speed and flexibility for modern development workflows.

Core Features & Use Cases

  • Fast Bundling: Leverages Rolldown for unparalleled build performance.
  • Multi-Format Output: Supports ESM, CJS, IIFE, and UMD formats.
  • Type Declarations: Automatically generates .d.ts files.
  • Use Case: Quickly bundle your new npm library, ensuring it's compatible with both modern ESM environments and older CommonJS runtimes, complete with type definitions for seamless TypeScript integration.

Quick Start

Use tsdown to bundle your TypeScript library with ESM and CJS formats, generating 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 for both ESM and CommonJS environments?

To bundle a TypeScript library for both ESM and CommonJS, use tsdown to compile multiple output formats simultaneously. It leverages the Rolldown engine to generate ESM and CJS bundles while automatically creating the necessary TypeScript declaration files.

What is the fastest way to generate TypeScript declaration files during a JavaScript library build?

Generating TypeScript declaration files during a JavaScript library build is handled automatically by tsdown. It integrates type declaration generation directly into the high-performance Rolldown bundling process, ensuring .d.ts files are produced alongside your ESM, CJS, IIFE, or UMD outputs.

Can I migrate my existing tsup configuration to a faster build tool?

You can migrate your existing tsup configuration to tsdown to achieve faster build performance. tsdown facilitates direct migration from tsup while replacing the underlying engine with Rolldown to optimize library build speeds and maintain multi-format output support.

Does this bundler support IIFE and UMD output formats for browser scripts?

Yes, the bundler supports IIFE and UMD output formats for browser scripts. tsdown allows you to compile your TypeScript or JavaScript library into these formats, alongside ESM and CJS, ensuring broad runtime compatibility.

Why should I use a Rolldown-powered bundler instead of standard JavaScript build tools?

A Rolldown-powered bundler provides unparalleled build performance compared to standard JavaScript build tools. tsdown leverages Rolldown's blazing-fast engine to dramatically reduce library bundling times while maintaining compatibility across modern and legacy output formats.

When do I need to bundle my npm package into multiple module formats?

You need to bundle your npm package into multiple module formats when ensuring compatibility across different JavaScript runtimes. tsdown compiles your TypeScript library into ESM, CJS, IIFE, and UMD formats so modern and legacy environments can consume it correctly.