plugins/tsdown/agent/skills/tsdown-migrate/SKILL.md
Migrate TypeScript library projects from tsup to tsdown. Provides complete option mappings, config transformation rules, default value differences, and unsupported option alternatives so AI agents can intelligently perform migrations.
npx skillsauth add pleaseai/claude-code-plugins plugins/tsdown/agent/skills/tsdown-migrateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Knowledge base for AI agents to migrate tsup projects to tsdown — the Rolldown-powered library bundler.
tsdown requires Node.js 22.18.0 or higher to run (build-time only). The bundled output can still target lower Node.js versions via the target option, so a library that previously supported Node.js 18 / 20 with tsup can continue to do so after migrating.
Recommended workflow when supporting Node.js 18 / 20:
target such as 'node18' or 'node20'.Follow these steps to migrate a tsup project:
tsup.config.* → tsdown.config.*'tsup' → 'tsdown'tsdown and verify output| tsup | tsdown |
|------|--------|
| tsup.config.ts | tsdown.config.ts |
| tsup.config.cts | tsdown.config.cts |
| tsup.config.mts | tsdown.config.mts |
| tsup.config.js | tsdown.config.js |
| tsup.config.cjs | tsdown.config.cjs |
| tsup.config.mjs | tsdown.config.mjs |
| tsup.config.json | tsdown.config.json |
// Before
import { defineConfig } from 'tsup'
// After
import { defineConfig } from 'tsdown'
Replace all identifiers: tsup → tsdown, TSUP → TSDOWN.
| tsup | tsdown | Notes |
|------|--------|-------|
| cjsInterop | cjsDefault | CJS default export handling |
| esbuildPlugins | plugins | Now uses Rolldown/Unplugin plugins |
| outExtension | outExtensions | Custom output extensions |
These tsup options still work in tsdown for backward compatibility, but emit deprecation warnings and will be removed in a future version. Migrate them immediately.
| tsup (deprecated) | tsdown (preferred) | Notes |
|--------------------|--------------------|-------|
| entryPoints | entry | Also deprecated in tsup itself |
| publicDir | copy | Copy static files to output |
| bundle: true | (remove) | Bundle is default behavior |
| bundle: false | unbundle: true | Preserve file structure |
| removeNodeProtocol: true | nodeProtocol: 'strip' | Strip node: prefix |
| injectStyle: true | css: { inject: true } | CSS injection |
| injectStyle: false | (remove) | Default behavior |
| external: [...] | deps: { neverBundle: [...] } | Moved to deps namespace |
| noExternal: [...] | deps: { alwaysBundle: [...] } | Moved to deps namespace |
| skipNodeModulesBundle | deps: { skipNodeModulesBundle: true } | Moved to deps namespace |
For IIFE builds, tsdown emits names like [name].iife.js, while tsup commonly emitted [name].global.js. outExtensions customizes extensions or suffixes, but it does not remove the built-in .iife or .umd segment. Use outputOptions.entryFileNames: '[name].global.js' to preserve old IIFE filenames.
Dependencies config moved under deps namespace. If both external and noExternal exist, merge into a single deps object:
// Before (tsup)
export default defineConfig({
external: ['react'],
noExternal: ['lodash-es'],
})
// After (tsdown)
export default defineConfig({
deps: {
neverBundle: ['react'],
alwaysBundle: ['lodash-es'],
},
})
tsdown also adds deps.onlyBundle (whitelist of allowed bundled packages) — no tsup equivalent.
// Before (tsup - esbuild plugins)
import plugin from 'unplugin-example/esbuild'
// After (tsdown - Rolldown plugins)
import plugin from 'unplugin-example/rolldown'
All unplugin-*/esbuild imports should change to unplugin-*/rolldown.
For complete before/after examples of every transformation, see guide-option-mappings.md.
tsdown changes several defaults from tsup. When migrating, explicitly set these to preserve tsup behavior, then let the user decide which new defaults to adopt.
| Option | tsup Default | tsdown Default | Migration Action |
|--------|-------------|----------------|-----------------|
| format | 'cjs' | 'esm' | Set format: 'cjs' to preserve |
| clean | false | true | Set clean: false to preserve |
| dts | false | Auto-enabled if types/typings in package.json | Set dts: false to preserve |
| target | (none) | Auto-reads from engines.node in package.json | Set target: false to preserve |
After migration, suggest the user review these — tsdown's defaults are generally better:
These tsup options have no direct equivalent in tsdown. Remove them and inform the user.
| tsup Option | Status | Alternative |
|-------------|--------|-------------|
| splitting | Always enabled | Remove — code splitting cannot be disabled in tsdown |
| metafile | Not available | Suggest devtools: true for Vite DevTools bundle analysis |
| swc | Not supported | Remove — tsdown uses oxc for transformation (built-in) |
| experimentalDts | Not supported | Use the dts option instead |
| legacyOutput | Not supported | Remove — no alternative |
| plugins (tsup experimental) | Incompatible | Migrate to Rolldown plugins manually; tsup's plugin API differs from Rolldown's |
Replace tsup and tsup-node with tsdown in all script commands:
// Before
{
"scripts": {
"build": "tsup src/index.ts",
"dev": "tsup --watch"
}
}
// After
{
"scripts": {
"build": "tsdown src/index.ts",
"dev": "tsdown --watch"
}
}
| Location | Action |
|----------|--------|
| dependencies.tsup | Rename to dependencies.tsdown |
| devDependencies.tsup | Rename to devDependencies.tsdown |
| optionalDependencies.tsup | Rename to optionalDependencies.tsdown |
| peerDependencies.tsup | Rename to peerDependencies.tsdown |
| peerDependenciesMeta.tsup | Rename to peerDependenciesMeta.tsdown |
If package.json has a root-level tsup field (inline config), rename to tsdown:
// Before
{ "tsup": { "entry": ["src/index.ts"] } }
// After
{ "tsdown": { "entry": ["src/index.ts"] } }
For detailed package.json examples, see guide-package-json.md.
After migration, suggest these tsdown-exclusive features to the user:
| Feature | Config | Description |
|---------|--------|-------------|
| Node protocol | nodeProtocol: true \| 'strip' | Add or strip node: prefix on built-in imports |
| Workspace | workspace: 'packages/*' | Build multiple packages in a monorepo |
| Package exports | exports: true | Auto-generate exports field in package.json |
| Package validation | publint: true, attw: true | Lint package and check type correctness |
| Executable | exe: true | Bundle as Node.js standalone executable (SEA) |
| DevTools | devtools: true | Vite DevTools integration for bundle analysis |
| Hooks | hooks: { 'build:done': ... } | Lifecycle hooks: build:prepare, build:before, build:done |
| CSS modules | css: { modules: { ... } } | Scoped class names for .module.css files |
| Glob import | globImport: true | Support import.meta.glob (Vite-style) |
For detailed comparisons, see guide-differences-detailed.md.
| Topic | Description | Reference | |-------|-------------|-----------| | Option Mappings | Complete before/after for every option transform | guide-option-mappings | | Detailed Differences | Architecture, features, compatibility comparison | guide-differences-detailed | | Package.json | Dependency, script, and config field migration | guide-package-json |
Use this checklist when performing a migration:
- [ ] Rename tsup.config.* → tsdown.config.*
- [ ] Update import from 'tsup' to 'tsdown'
- [ ] Replace tsup/TSUP identifiers with tsdown/TSDOWN
- [ ] Apply property renames (cjsInterop→cjsDefault, esbuildPlugins→plugins, outExtension→outExtensions)
- [ ] Migrate deprecated options (publicDir→copy, bundle→unbundle, removeNodeProtocol→nodeProtocol, injectStyle→css.inject)
- [ ] Move external/noExternal/skipNodeModulesBundle into deps namespace
- [ ] Update unplugin imports from /esbuild to /rolldown
- [ ] Set explicit defaults to preserve tsup behavior (format, clean, dts, target)
- [ ] Remove unsupported options (splitting, metafile, swc, etc.)
- [ ] Update package.json scripts (tsup→tsdown)
- [ ] Update package.json dependencies
- [ ] Rename root-level tsup config field if present
- [ ] Run tsdown and verify build output
- [ ] Suggest new tsdown features to the user
tools
Creates durable, resumable workflows using Vercel's Workflow SDK. Use when building workflows that need to survive restarts, pause for external events, retry on failure, or coordinate multi-step operations over time. Triggers on mentions of "workflow", "durable functions", "resumable", "workflow sdk", "queue", "event", "push", "subscribe", or step-based orchestration.
tools
Install and configure Vercel Workflow SDK before it exists in node_modules. Use when the user asks to "install workflow", "set up workflow", "add durable workflows", "configure workflow sdk", or "init workflow" for Next.js, Express, Hono, Fastify, NestJS, Nitro, Nuxt, Astro, SvelteKit, or Vite.
tools
Migrates Temporal, Inngest, Trigger.dev, and AWS Step Functions workflows to the Workflow SDK. Use when porting Activities, Workers, Signals, step.run(), step.waitForEvent(), Trigger.dev tasks / wait.forToken / triggerAndWait, ASL JSON state machines, Task/Choice/Wait/Parallel states, task tokens, or child workflows.
tools
Use when building UIs leveraging the WordPress Design System (WPDS) and its components, tokens, patterns, etc.