tsdown

Bundle TypeScript and JavaScript libraries into esm, cjs, iife, and umd formats with Rolldown.

Updated Apr 6, 2022
One-click install
npx skills add https://github.com/wjyugutou/study-test-demo --skill tsdown-wjyugutou
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tsdown
Source: https://github.com/wjyugutou/study-test-demo/tree/main/.trae/skills/tsdown
Command: npx skills add https://github.com/wjyugutou/study-test-demo --skill tsdown-wjyugutou

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bundling TypeScript and JavaScript libraries quickly and consistently across formats is time-consuming and error-prone; this Skill automates the process using Rolldown to produce multiple formats and type declarations.

Core Features & Use Cases

  • Multi-format bundles: esm, cjs, iife, and umd from a single config.
  • DTS generation support to publish TypeScript types alongside code.
  • Migration and monorepo friendly: easily move from tsup or scale across packages.

Quick Start

Run tsdown in your project with a tsdown.config.ts or via CLI to build all configured outputs. For example: tsdown --watch to rebuild on changes.

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 multiple formats, you can use this Skill to automatically generate esm, cjs, iife, and umd outputs from a single configuration. It leverages Rolldown to produce these bundles alongside your DTS type declarations.

How do I migrate my library build from tsup to a faster bundler?▼

Migrating from tsup to a faster bundler is directly supported by this Skill. It provides a migration-friendly setup using Rolldown to accelerate your library publishing while maintaining multi-format outputs.

Can I generate dts type declarations when building JavaScript libraries with Rolldown?▼

Yes, you can generate dts type declarations when building JavaScript libraries. This Skill includes DTS generation support to publish TypeScript types alongside your bundled multi-format code outputs.

Does this bundler work with monorepos to build multiple TypeScript packages?▼

Yes, this bundler works with monorepos to build multiple TypeScript packages. It is monorepo friendly, allowing you to scale across packages easily while producing consistent multi-format bundles and type declarations.

What is the best way to accelerate TypeScript library publishing with multi-format outputs?▼

The best way to accelerate TypeScript library publishing is by automating the process with Rolldown. This Skill targets library authors needing multi-format outputs and DTS generation, using a single config to build consistently and quickly.

Do I need a tsdown.config.ts to build my JavaScript library?▼

You can use a tsdown.config.ts or the CLI to build your JavaScript library. Running it in your project with the config file allows you to build all configured outputs, and you can use flags like --watch to rebuild on changes.