tsdown

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

14|5|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/oakoss/agent-skills --skill tsdown-oakoss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsdown
Source: https://github.com/oakoss/agent-skills/tree/main/skills/tsdown
Command: npx skills add https://github.com/oakoss/agent-skills --skill tsdown-oakoss

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the process of building and bundling TypeScript libraries, handling complex configurations for various output formats, declaration files, and build optimizations.

Core Features & Use Cases

  • Library Bundling: Compiles TypeScript/JavaScript libraries into multiple formats (ESM, CJS, IIFE, UMD).
  • Declaration Files: Automatically generates TypeScript declaration files (.d.ts).
  • Optimizations: Supports tree shaking, minification, and source map generation.
  • Use Case: When developing a reusable UI component library for npm, use this Skill to ensure it's correctly bundled for both CommonJS and ES Module environments, with accurate type definitions.

Quick Start

Use the tsdown skill to build the library located in the 'src' directory.

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 output formats involves compiling source code into ESM, CJS, IIFE, and UMD. This Skill uses Rolldown to handle these configurations and generate distributable package files.

How do I generate TypeScript declaration files when building a package?

Generating TypeScript declaration files during package builds is handled automatically by this Skill. It produces `.d.ts` files alongside your bundled JavaScript outputs to ensure accurate type definitions for consumers.

Does Rolldown support tree shaking and minification for library builds?

Yes, Rolldown supports tree shaking and minification for library builds. This Skill applies these build optimizations, along with source map generation, to reduce bundle size and improve performance.

What is the best way to configure a TypeScript bundler for npm publishing?

The best way to configure a TypeScript bundler for npm publishing is using a `tsdown.config.ts` file. This Skill reads your configuration to streamline package bundling and ensure correct distribution across environments.

Can I build a UI component library that works in both CommonJS and ES Module environments?

Yes, you can build a UI component library that works in both CommonJS and ES Module environments. This Skill bundles your TypeScript code into multiple formats simultaneously to ensure broad compatibility.

Do I need the tsdown CLI to build JavaScript libraries?

Yes, you need the tsdown CLI to execute the build process. This Skill requires the CLI to run the Rolldown bundler, apply optimizations, and generate the final distributable library outputs.