tsdown

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

316|49|Updated Aug 23, 2023
One-click install
npx skills add https://github.com/nolebase/integrations --skill tsdown-nolebase
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsdown
Source: https://github.com/nolebase/integrations/tree/main/.agents/skills/tsdown
Command: npx skills add https://github.com/nolebase/integrations --skill tsdown-nolebase

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires rolldown, vite, unplugin, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines building TypeScript and JavaScript libraries by enabling high-speed bundling, declaration generation, and multi-format output.

Core Features & Use Cases

  • Library Bundling: Efficiently compiles and bundles library code into multiple formats including ESM, CJS, IIFE, and UMD.
  • Type Declarations: Fully automates generating .d.ts files for TypeScript projects.
  • Dependency Management: Supports externalizing dependencies, whitelists, and custom dependency configurations.
  • Advanced Configuration: Custom build options, CSS handling, plugin support, and CI-aware settings for complex workflows.
  • Use Case: Perfect for library authors needing reliable, fast builds with minimal setup, ensuring compatibility across node, browsers, and monorepos.

Quick Start

Run tsdown to build your main library by specifying your source entry file and desired formats directly with the CLI.

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 like ESM and CJS, you can use a fast bundler that compiles source entry files into ESM, CJS, IIFE, and UMD outputs. This ensures compatibility across different JavaScript environments with minimal configuration.

What is the best way to automate generating .d.ts type declaration files for a TypeScript project?

Automating .d.ts type declaration file generation for a TypeScript project is handled by bundlers with built-in declaration support. The tool fully automates generating these files during the build process, eliminating the need for manual type definition management.

Does this TypeScript bundler work in a monorepo and CI/CD environment?

Yes, this TypeScript bundler works in monorepos and CI/CD environments through CI-aware settings and advanced configuration options. It supports dependency externalizing and custom configurations, ensuring reliable, fast builds across complex professional software engineering workflows.

How do I externalize dependencies or create a whitelist when building a JavaScript library?

To externalize dependencies or create a whitelist when building a JavaScript library, you can utilize custom dependency configurations within the bundler. This allows precise dependency control by externalizing specific packages while bundling others directly into the final output.

Can I use Vite plugins or unplugin with this library bundler?

Yes, you can use Vite plugins and unplugin with this library bundler because it is built on Rolldown and Vite dependencies. It supports advanced configuration and plugin support, allowing you to extend the build process with custom CSS handling and other workflows.

Why choose a Rolldown-based bundler over other tools for library builds?

Choosing a Rolldown-based bundler over other tools provides high-speed bundling and multi-format output for TypeScript libraries. It combines rapid compilation with automated declaration generation and advanced dependency management, differentiating it from standard category-level alternatives.