tsdown

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

3|2|Updated Mar 14, 2023
One-click install
npx skills add https://github.com/2digits-agency/configs --skill tsdown-2digits-agency
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsdown
Source: https://github.com/2digits-agency/configs/tree/main/.agents/skills/tsdown
Command: npx skills add https://github.com/2digits-agency/configs --skill tsdown-2digits-agency

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bundles TypeScript and JavaScript libraries quickly and reliably.

Core Features & Use Cases

  • Supports multi-format outputs (esm, cjs, iife, umd) for library distribution
  • Generates TypeScript declarations (dts) and migration guidance for tsup
  • Handles monorepos/workspaces with shared config and exports

Quick Start

Install tsdown and run a build to produce multi-format bundles from your TS/JS library.

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?

Bundling a TypeScript library into ESM and CJS outputs requires a tool that supports multi-format compilation. This process generates distribution-ready files and TypeScript declarations simultaneously, ensuring broad compatibility across different JavaScript module consumption environments.

What is the best way to migrate a tsup configuration to another bundler?

Migrating from tsup involves transferring your existing configuration to a faster alternative. This transition maintains your multi-format output and declaration generation capabilities while providing specific guidance to ensure the migration process is reliable and quick.

How do I manage shared bundling configurations across a monorepo workspace?

Monorepo workspace bundling requires a tool that handles shared configurations and package exports. This ensures consistent multi-format output generation across all workspace packages, streamlining the build process for multiple interconnected TypeScript libraries.

Does tsdown support generating TypeScript declaration files during the build?

Generating TypeScript declarations is a supported feature during the build process. This allows library authors to output type definitions alongside multi-format JavaScript bundles without requiring a separate compilation step or additional tooling.

Can I bundle JavaScript libraries using tsdown or is it strictly for TypeScript?

You can bundle both JavaScript and TypeScript libraries. The tool handles multi-format outputs for both languages, providing fast and reliable bundling for library authors regardless of whether the source uses JavaScript or TypeScript.

Why should I consider an alternative bundler for my TypeScript library migration?

Considering an alternative bundler for TypeScript library migration offers faster build speeds and reliable multi-format output generation. It provides specific guidance for transitioning from existing tools while maintaining DTS generation and monorepo workspace support.