tsdown
Fast TypeScript/JavaScript library bundler powered by Rolldown with multi-format output and type declaration generation.
- Supports bundling to ESM, CJS, IIFE, and UMD formats with automatic peer dependency externalization and tree shaking
- Generates TypeScript declaration files (.d.ts) with source map and compiler option control, plus experimental CSS pipeline with preprocessor and PostCSS support
- Includes watch mode, minification, source maps, unbundle mode for preserving directory structure, and framework-specific recipes for React, Vue, Solid, and Svelte
- Offers CLI commands, programmatic API, lifecycle hooks, workspace/monorepo support, and direct Rolldown option passthrough for advanced customization
- Provides migration tooling from tsup and experimental features for standalone executable bundling and package validation (publint, attw)
tsdown - The Elegant Library Bundler
Blazing-fast bundler for TypeScript/JavaScript libraries powered by Rolldown and Oxc.
When to Use
- Building TypeScript/JavaScript libraries for npm
- Generating TypeScript declaration files (.d.ts)
- Bundling for multiple formats (ESM, CJS, IIFE, UMD)
- Optimizing bundles with tree shaking and minification
- Migrating from tsup with minimal changes
- Building React, Vue, Solid, or Svelte component libraries
Quick Start
# Install
pnpm add -D tsdown
More from antfu/skills
vite
Vite build tool configuration, plugin API, SSR, and Vite 8 Rolldown migration. Use when working with Vite projects, vite.config.ts, Vite plugins, or building libraries/SSR apps with Vite.
21.8Kvue
Vue 3 Composition API, script setup macros, reactivity system, and built-in components. Use when writing Vue SFCs, defineProps/defineEmits/defineModel, watchers, or using Transition/Teleport/Suspense/KeepAlive.
21.8Kvitest
Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.
18.0Kvue-best-practices
MUST be used for Vue.js tasks. Strongly recommends Composition API with `<script setup>` and TypeScript as the standard approach. Covers Vue 3, SSR, Volar, vue-tsc. Load for any Vue, .vue files, Vue Router, Pinia, or Vite with Vue work. ALWAYS use Composition API unless the project explicitly requires Options API.
15.9Knuxt
Nuxt full-stack Vue framework with SSR, auto-imports, and file-based routing. Use when working with Nuxt apps, server routes, useFetch, middleware, or hybrid rendering.
14.9Kvueuse-functions
Apply VueUse composables where appropriate to build concise, maintainable Vue.js / Nuxt features.
14.6K