MCPInstall

tsdown-migrate

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.

Installs
389
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/rolldown/tsdown --skill tsdown-migrate
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads tsdown-migrate automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Migrating from tsup to tsdown

Knowledge base for AI agents to migrate tsup projects to tsdown — the Rolldown-powered library bundler.

Target Version: Two-Stage Migration

tsdown v0.23 removed all previously-deprecated tsup compatibility options — bundle, outExtension, publicDir, removeNodeProtocol, injectStyle, and skipNodeModulesBundle are no longer recognized. They fail TypeScript type checking and are silently ignored at runtime, so a missed mapping on v0.23+ produces wrong output without any error. Migrating directly to v0.23+ is therefore unsafe. tsdown v0.22.14 is the last version that still accepts these options and flags each one with a deprecation warning, making it the safe migration checkpoint. Migrate in two stages:

  1. Stage 1 — migrate on tsdown@0.22.14: Install tsdown@0.22.14, migrate the config per the tables below, run a build, and resolve every deprecation warning by mapping each flagged tsup option to its real tsdown equivalent. The warnings are the completeness check — the migration is not done until the build produces zero warnings.
  2. Stage 2 — upgrade to the latest tsdown (^0.23.0 or newer): Only after a warning-free build on 0.22.14. Since the config no longer uses any removed compat options, the silent-ignore behavior of v0.23+ is no longer a risk.

Runtime Requirement

tsdown requires Node.js ^22.18.0 || ^24.11.0 || >=26.0.0 to run (build-time only) — that is, Node.js 22.18+, 24.11+, or 26+. Odd-numbered and EOL release lines (e.g. Node.js 23, 25) are not supported. 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:

  • Build with Node.js 22+ in CI, setting an explicit target such as 'node18' or 'node20'.
  • Test the built output (or the packed tarball) on the lower Node.js versions you need to support.

When to Use

  • Migrating a project from tsup to tsdown
  • Understanding differences between tsup and tsdown options
  • Reviewing or fixing post-migration configuration issues
  • Advising users on tsup→tsdown compatibility

Migration Overview

Follow these steps to migrate a tsup project:

  1. Rename config file: tsup.config.* → tsdown.config.*
  2. Update imports: 'tsup' → 'tsdown'
  3. Apply option mappings: Rename/transform options per tables below
  4. Preserve tsup defaults: Explicitly set options that differ (format, clean, dts, target)
  5. Update package.json: Dependencies (Stage 1: tsdown@0.22.14), scripts, root config field
  6. Remove unsupported options: Replace with alternatives where available
  7. Test build on 0.22.14: Run tsdown and resolve every deprecation warning — zero warnings required
  8. Upgrade to latest tsdown (^0.23.0 or newer) and verify the build again

Config File Migration

File Rename

tsuptsdown
tsup.config.tstsdown.config.ts
tsup.config.ctstsdown.config.cts
tsup.config.mtstsdown.config.mts
tsup.config.jstsdown.config.js
tsup.config.cjstsdown.config.cjs
tsup.config.mjstsdown.config.mjs
tsup.config.jsontsdown.config.json

Import and Identifier Changes

// Before
import { defineConfig } from 'tsup'

// After
import { defineConfig } from 'tsdown'

Replace all identifiers: tsup → tsdown, TSUP → TSDOWN.

Option Mappings

Property Renames

tsuptsdownNotes
entryPointsentryAlso deprecated in tsup itself
cjsInteropcjsDefaultCJS default export handling
esbuildPluginspluginsNow uses Rolldown/Unplugin plugins
outExtensionoutExtensionsCustom output extensions
publicDircopyCopy static files to output
bundle: true(remove)Bundle is default behavior
bundle: falseunbundle: truePreserve file structure
removeNodeProtocol: truenodeProtocol: 'strip'Strip node: prefix
injectStyle: truecss: { inject: true }CSS injection
injectStyle: false(remove)Default behavior
skipNodeModulesBundledeps: { neverBundle: true }Externalize all dependencies

None of the old names are recognized by tsdown v0.23+ — always emit the new names. The compatibility options (outExtension, skipNodeModulesBundle, publicDir, bundle, removeNodeProtocol, injectStyle) were accepted with deprecation warnings up to v0.22.14 and removed entirely in v0.23; on v0.23+ leftovers are silently ignored, not errors, so builds misbehave without warning. This is why Stage 1 runs on v0.22.14, where every leftover is flagged.

Deprecated but Still Accepted

external and noExternal are the only tsup option names tsdown v0.23 still accepts. They emit deprecation warnings, will be removed in a future version, and cannot be combined with their replacements (mixing external with deps.neverBundle, or noExternal with deps.alwaysBundle, throws an error). Always emit the replacements.

tsup (deprecated)tsdown (preferred)Notes
external: [...]deps: { neverBundle: [...] }Moved to deps namespace
noExternal: [...]deps: { alwaysBundle: [...] }Moved to deps namespace

Output Filename Differences

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.

Dependency Namespace Moves

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.

Dependency handling defaults in tsdown v0.23+:

  • dependencies, peerDependencies, and optionalDependencies are all externalized by default (tsup only externalizes dependencies and peerDependencies, so optionalDependencies may switch from bundled to external after migration).
  • deps.resolveDepSubpath (resolving subpath imports of externalized packages without an exports field) is disabled by default.

Plugin Import Transforms

// 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.

Default Value Differences

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.

Optiontsup Defaulttsdown DefaultMigration Action
format'cjs''esm'Set format: 'cjs' to preserve
cleanfalsetrueSet clean: false to preserve
dtsfalseAuto-enabled if types/typings in package.jsonSet dts: false to preserve
target(none)Auto-reads from engines.node in package.jsonSet target: false to preserve

After migration, suggest the user review these — tsdown's defaults are generally better:

  • ESM is the modern standard
  • Cleaning output prevents stale files
  • Auto DTS from package.json reduces config
  • Auto target from engines.node ensures consistency

Unsupported Options

These tsup options have no direct equivalent in tsdown. Remove them and inform the user.

tsup OptionStatusAlternative
splittingAlways enabledRemove — code splitting cannot be disabled in tsdown
metafileNot availableSuggest devtools: true for Vite DevTools bundle analysis
swcNot supportedRemove — tsdown uses oxc for transformation (built-in)
experimentalDtsNot supportedUse the dts option instead
legacyOutputNot supportedRemove — no alternative
plugins (tsup experimental)IncompatibleMigrate to Rolldown plugins manually; tsup's plugin API differs from Rolldown's

Package.json Migration

Scripts

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"
  }
}

Dependencies

LocationAction
dependencies.tsupRename to dependencies.tsdown
devDependencies.tsupRename to devDependencies.tsdown
optionalDependencies.tsupRename to optionalDependencies.tsdown
peerDependencies.tsupRename to peerDependencies.tsdown
peerDependenciesMeta.tsupRename to peerDependenciesMeta.tsdown

Root Config Field

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.

New tsdown Features

After migration, suggest these tsdown-exclusive features to the user:

FeatureConfigDescription
Node protocolnodeProtocol: true | 'strip'Add or strip node: prefix on built-in imports
Workspaceworkspace: 'packages/*'Build multiple packages in a monorepo
Package exportsexports: trueAuto-generate exports field in package.json
Package validationpublint: true, attw: trueLint package and check type correctness
Executableexe: trueBundle as Node.js standalone executable (SEA)
DevToolsdevtools: trueVite DevTools integration for bundle analysis
Hookshooks: { 'build:done': ... }Lifecycle hooks: build:prepare, build:before, build:done
CSS modulescss: { modules: { ... } }Scoped class names for .module.css files
Glob importglobImport: trueSupport import.meta.glob (Vite-style)

For detailed comparisons, see guide-differences-detailed.md.

References

TopicDescriptionReference
Option MappingsComplete before/after for every option transformguide-option-mappings
Detailed DifferencesArchitecture, features, compatibility comparisonguide-differences-detailed
Package.jsonDependency, script, and config field migrationguide-package-json

Migration Checklist

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, publicDir→copy, bundle→unbundle, removeNodeProtocol→nodeProtocol, injectStyle→css.inject)
- [ ] Move external/noExternal into deps namespace, replace skipNodeModulesBundle with `deps.neverBundle: true`
- [ ] 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 (Stage 1: tsdown@0.22.14)
- [ ] Rename root-level tsup config field if present
- [ ] Run tsdown on 0.22.14 and resolve every deprecation warning (zero warnings required)
- [ ] Upgrade to the latest tsdown (^0.23.0 or newer) and verify the build again
- [ ] Suggest new tsdown features to the user

FAQ

What does the tsdown-migrate skill do?

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.

How do I install tsdown-migrate?

Run npx skills add https://github.com/rolldown/tsdown --skill tsdown-migrate in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/tsdown-migrate/ (personal) or .claude/skills/tsdown-migrate/ (project).

Which AI agents can use tsdown-migrate?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is tsdown-migrate safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains tsdown-migrate?

It is published by rolldown in rolldown/tsdown. It has 389 recorded installs.

More from rolldown/tsdown

View all →

tsdown

rolldown/tsdown

Bundle TypeScript and JavaScript libraries with blazing-fast speed powered by Rolldown. Use when building libraries, generating type declarations, bundling for multiple formats, or migrating from tsup.

Popular ai & agents skills

View category →

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents513.9K installs

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents513.5K installs

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents416.4K installs

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents402.1K installs

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401K installs

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents245.7K installs