tsdown

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

3.1k|47|Updated Apr 16, 2023
One-click install
npx skills add https://github.com/next-safe-action/next-safe-action --skill tsdown-next-safe-action
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsdown
Source: https://github.com/next-safe-action/next-safe-action/tree/main/.agents/skills/tsdown
Command: npx skills add https://github.com/next-safe-action/next-safe-action --skill tsdown-next-safe-action

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 blazing-fast build times and robust configuration options.

Core Features & Use Cases

  • High-Speed Bundling: Powered by Rolldown (Rust) and Oxc, delivering unparalleled build performance.
  • Multi-Format Output: Generate bundles in ESM, CJS, IIFE, and UMD formats.
  • Type Declaration Generation: Automatically create .d.ts files for better TypeScript integration.
  • Use Case: When building a reusable UI component library for multiple frameworks or when migrating a complex project from tsup, tsdown provides a fast, efficient, and compatible solution.

Quick Start

Configure tsdown to bundle your TypeScript library into both ESM and CJS formats with type declarations enabled.

Frequently Asked Questions about tsdown

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I bundle TypeScript libraries with multiple output formats?

Bundling TypeScript libraries with multiple output formats involves configuring the build to generate ESM, CJS, IIFE, and UMD files simultaneously. This approach uses Rolldown and Oxc to deliver fast build performance while ensuring broad module compatibility.

What is the fastest way to generate type declarations during a JavaScript library build?

The fastest way to generate type declarations during a JavaScript library build is using a Rust-powered bundler. This mechanism automatically creates .d.ts files, ensuring robust TypeScript integration without slowing down your build pipeline.

Can I migrate my existing tsup configuration to a faster bundler?

Yes, you can migrate your existing tsup configuration to a faster bundler. Designed as a compatible solution, it streamlines the migration process for complex projects by offering robust configuration options while significantly boosting build speed using Rolldown.

Does this bundler support plugins and hooks for framework integration?

Yes, this bundler supports plugins and hooks for framework integration. These advanced features allow you to customize the bundling process extensively, making it suitable for building reusable UI component libraries across multiple frameworks.

Why should I use a Rust-based bundler for JavaScript library development?

You should use a Rust-based bundler for JavaScript library development to achieve unparalleled build performance. By leveraging Rolldown and Oxc, it drastically reduces build times compared to traditional tools, streamlining the entire bundling process.