PluginBench
Skill
Fail
Audit score 45

tsdown

onmax/nuxt-skills

Rolldown + Oxc powered TypeScript bundler for npm packages with dual ESM/CJS output and .d.ts generation.

What is tsdown?

tsdown is a modern TypeScript bundler designed for building and publishing npm packages. Use it when you need to bundle TypeScript libraries with automatic declaration file generation, dual module format support, and package validation.

  • Bundle TypeScript libraries with Rolldown + Oxc for fast builds
  • Generate .d.ts type declaration files automatically
  • Output dual ESM and CommonJS formats simultaneously
  • Validate package exports and configuration
  • Support Vue and React component libraries
  • Watch mode for development iteration

How to install tsdown

npx skills add https://github.com/onmax/nuxt-skills --skill tsdown
Prerequisites
  • Node.js and npm or compatible package manager
  • TypeScript installed as a dev dependency
Claude Code
Cursor
Windsurf
Cline

How to use tsdown

  1. 1.Install tsdown and TypeScript as dev dependencies: npm i -D tsdown typescript
  2. 2.Create a tsdown.config.ts file with entry point and output options
  3. 3.Configure format (esm/cjs), dts generation, and exports settings
  4. 4.Run tsdown to build or tsdown --watch for development mode
  5. 5.Reference config.md for CLI and entry point setup, output.md for format/target/validation, features.md for watch/framework integration, or advanced.md for plugins and programmatic API

Use cases

Good for
  • Publishing a TypeScript utility library to npm with type definitions
  • Building a Vue component library with dual module outputs
  • Migrating from tsup to a faster Rolldown-based bundler
  • Generating declaration files for a React component package
  • Setting up a monorepo package with validated exports
Who it's for
  • TypeScript library authors
  • npm package maintainers
  • Vue/React component library developers
  • Teams migrating from tsup

tsdown FAQ

What is tsdown and how does it differ from tsup?

tsdown is a modern TypeScript bundler powered by Rolldown and Oxc, designed as a drop-in tsup replacement with faster builds and better performance.

Can tsdown generate TypeScript declaration files?

Yes, tsdown can automatically generate .d.ts declaration files by setting dts: true in your configuration.

Does tsdown support both ESM and CommonJS output?

Yes, tsdown can generate dual ESM/CJS output formats simultaneously for maximum compatibility.

What frameworks does tsdown support?

tsdown supports Vue and React component libraries, with additional framework integrations available through the features.md reference.

How do I migrate from tsup to tsdown?

Refer to the advanced.md reference file which includes migration guidance from tsup to tsdown.

Full instructions (SKILL.md)

Source of truth, from onmax/nuxt-skills.


name: tsdown description: Use when bundling TypeScript libraries - provides tsdown configuration, dual ESM/CJS output, .d.ts generation, package validation, and plugin authoring license: MIT

tsdown

Rolldown + Oxc powered TypeScript bundler. Drop-in tsup replacement.

When to Use

  • Building TypeScript libraries
  • Generating .d.ts declarations
  • Publishing npm packages
  • Dual ESM/CJS output
  • Vue/React component libraries

Quick Start

npm i -D tsdown typescript
// tsdown.config.ts
import { defineConfig } from 'tsdown'

export default defineConfig({
  entry: 'src/index.ts',
  format: 'esm',
  dts: true,
  exports: true,
})
tsdown           # Build
tsdown --watch   # Watch mode

Reference Files

TaskFile
Config file, CLI, entry pointsconfig.md
Format, target, dts, exports, validationoutput.md
Shims, unbundle, watch, frameworks, WASMfeatures.md
Plugins, hooks, lint, programmatic, migrationadvanced.md

Loading Files

Consider loading these reference files based on your task:

DO NOT load all files at once. Load only what's relevant to your current task.

Cross-Skill References

  • Library patterns → Use ts-library skill
  • Vue component libs → Use vue skill
  • Package management → Use pnpm skill