tsdown-migrate

A migration guide for moving TypeScript library projects from tsup to tsdown. tsup and tsdown are tools that bundle TypeScript libraries into distributable files.

In plain words
What is it for?
Installing the transition version, converting tsup configuration, checking builds and deprecation warnings, and then upgrading to tsdown 0.23 or later.
Why use it?
It explains changed configuration options and uses a two-stage upgrade so unsupported settings are mapped before moving to newer tsdown versions.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/rolldown/tsdown/tsdown-migrate
Any agent
npx skills add rolldown/tsdown --skill tsdown-migrate
Clone the repo
git clone --depth 1 https://github.com/rolldown/tsdown

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,304 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.03304
Opus 5 $0.00022 $0.01652
Sonnet 5 $0.00009 $0.00661
Haiku 4.5 $0.00004 $0.00330

Measured 2d ago against content hash 444ba2ab9b7d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tsdown-migrate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/tsdown-migrate/SKILL.md · 270 lines

How it starts

The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 [email protected]: Install [email protected], 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.

Read the full file on GitHub · 270 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 270 lines · 43 tokens per session scan A 444ba2ab9b7d

Subscribe to this mod's changes

tsdown-migrate is a skill published in the GitHub repository rolldown/tsdown (4,238 stars, last pushed 4d ago), licensed MIT. It adds 43 tokens to every session and 3,304 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.