tsdown
$
npx mdskill add onmax/nuxt-skills/tsdownBundles TypeScript libraries with dual ESM/CJS output and declaration files
- Simplifies building and publishing TypeScript libraries
- Uses Rolldown and Oxc for fast, reliable bundling
- Generates .d.ts files and validates package structure
- Supports watch mode and plugin-based customization
SKILL.md
.github/skills/tsdownView on GitHub ↗
---
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
```bash
npm i -D tsdown typescript
```
```ts
// tsdown.config.ts
import { defineConfig } from 'tsdown'
export default defineConfig({
entry: 'src/index.ts',
format: 'esm',
dts: true,
exports: true,
})
```
```bash
tsdown # Build
tsdown --watch # Watch mode
```
## Reference Files
| Task | File |
| --------------------------------------------- | ------------------------------------- |
| Config file, CLI, entry points | [config.md](references/config.md) |
| Format, target, dts, exports, validation | [output.md](references/output.md) |
| Shims, unbundle, watch, frameworks, WASM | [features.md](references/features.md) |
| Plugins, hooks, lint, programmatic, migration | [advanced.md](references/advanced.md) |
## Loading Files
**Consider loading these reference files based on your task:**
- [ ] [references/config.md](references/config.md) - if setting up tsdown.config.ts, CLI, or entry points
- [ ] [references/output.md](references/output.md) - if configuring output format, target, .d.ts, exports, or validation
- [ ] [references/features.md](references/features.md) - if using shims, unbundle, watch mode, framework integrations, or WebAssembly
- [ ] [references/advanced.md](references/advanced.md) - if writing plugins, using linting/validation, programmatic API, or migrating from tsup
**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
More from onmax/nuxt-skills
- document-writerUse when writing blog posts or documentation markdown files - provides writing style guide (active voice, present tense), content structure patterns, and MDC component usage. Overrides brevity rules for proper grammar. Use nuxt-content for MDC syntax, nuxt-ui for component props.
- motionUse when adding animations with Motion Vue (motion-v) - provides motion component API, gesture animations, scroll-linked effects, layout transitions, and composables for Vue 3/Nuxt
- nuxtUse when working on Nuxt 4+ projects - provides server routes, file-based routing, middleware patterns, Nuxt-specific composables, and configuration with latest docs. Covers h3 v1 helpers (validation, WebSocket, SSE) and nitropack v2 patterns. Updated for Nuxt 4.3+.
- nuxt-better-authUse when implementing auth in Nuxt apps with @onmax/nuxt-better-auth - provides useUserSession composable, server auth helpers, route protection, and Better Auth plugins integration.
- nuxt-contentUse when working with Nuxt Content v3, markdown content, or CMS features in Nuxt - provides collections (local/remote/API sources), queryCollection API, MDC rendering, database configuration, NuxtStudio integration, hooks, i18n patterns, and LLMs integration
- nuxt-modulesUse when creating Nuxt modules: (1) Published npm modules (@nuxtjs/, nuxt-), (2) Local project modules (modules/ directory), (3) Runtime extensions (components, composables, plugins), (4) Server extensions (API routes, middleware), (5) Releasing/publishing modules to npm, (6) Setting up CI/CD workflows for modules. Provides defineNuxtModule patterns, Kit utilities, hooks, E2E testing, and release automation.
- nuxt-seoNuxt SEO meta-module with robots, sitemap, og-image, schema-org. Use when configuring SEO, generating sitemaps, creating OG images, or adding structured data.
- nuxt-studioUse when working with Nuxt Studio, the self-hosted open-source CMS for Nuxt Content sites - provides visual editing, media management, Git-based publishing, auth providers, and AI content assistance
- nuxt-uiUse when building styled UI with @nuxt/ui v4 components - create forms with validation, implement data tables with sorting, build modal dialogs and overlays, configure Tailwind Variants theming. Use vue skill for raw component patterns, reka-ui for headless primitives.
- nuxthubUse when building NuxtHub v0.10.6 applications - provides database (Drizzle ORM with sqlite/postgresql/mysql), KV storage, blob storage, and cache APIs. Covers configuration, schema definition, migrations, multi-cloud deployment (Cloudflare, Vercel), and the new hub:db, hub:kv, hub:blob virtual module imports.