tsdown-migrate

rolldown/tsdown

Миграция проектов библиотек TypeScript с tsup на tsdown: сопоставление опций, правила преобразования конфигов и различия значений по умолчанию.

Звёзды4 344
Авторrolldown
Установок403

Установка

SKILL.md

Migrating from tsup to tsdown

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

Runtime Requirement

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:

  • 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, scripts, root config field
  6. Remove unsupported options: Replace with alternatives where available
  7. Test build: Run tsdown and verify output

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
cjsInteropcjsDefaultCJS default export handling
esbuildPluginspluginsNow uses Rolldown/Unplugin plugins
outExtensionoutExtensionsCustom output extensions

Deprecated but Compatible

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
entryPointsentryAlso deprecated in tsup itself
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
external: [...]deps: { neverBundle: [...] }Moved to deps namespace
noExternal: [...]deps: { alwaysBundle: [...] }Moved to deps namespace
skipNodeModulesBundledeps: { neverBundle: true }Externalize all dependencies

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.

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)
- [ ] Migrate deprecated options (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
- [ ] Rename root-level tsup config field if present
- [ ] Run tsdown and verify build output
- [ ] Suggest new tsdown features to the user

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: tsdown-migrate](https://darkplay.ru/ai/skills/rolldown-tsdown-tsdown-migrate)

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

claude-opus-4-5-migrationanthropics · Перенос кода и промптов с Sonnet 4.x и Opus 4.1 на Opus 4.5.
34 комп.
astronomer-data-agentsanthropics · Инженерия данных для Apache Airflow и Astronomer: написание DAG по лучшим практикам…
100 комп.
aws-transformanthropics · Миграция, модернизация и обновление кодовых баз на AWS: .NET Framework в .NET 8/10, COBOL…
100 комп.
dataanthropics · Инженерия данных для Apache Airflow и Astronomer. Создание DAG по лучшим практикам…
100 комп.
Azure Iac Exportergithub · Экспорт существующих ресурсов Azure в шаблоны Infrastructure as Code через анализ Azure…
36 140 ★
pwalirezarezvani · Продакшн-тулкит для тестирования на Playwright: 9 навыков, 3 агента, 55 шаблонов…
510 комп.
astronomeranthropics · Data engineering для Airflow и Astronomer: DAG, отладка, lineage, миграция на Airflow 3.
38 комп.
astronomer-data-agentsanthropics · Data engineering для Airflow и Astronomer: DAG, отладка пайплайнов, lineage и миграция.
38 комп.
cplnanthropics · Развёртывание и управление нагрузками в Control Plane — виртуальном облаке поверх AWS…
38 комп.
nganthropics · Помощник по Angular: генерация, ревью, тестирование и миграция приложений.
38 комп.

Лучшие ИИ-инструменты для автоматизации и ассистентов

Ассистенты и автоматизация

Подборка ИИ-ассистентов для автоматизации рутины и ускорения рабочих процессов. Сервисы, которые берут на себя переписку, анализ данных, ведение базы знаний и подготовку продаж, эк

Give Me Public
Есть бесплатный тариф
5.0
AITunnelAitunnel
По запросу
5.0
STIVAStiva
По запросу
5.0
Wikibot (Викибот)Wikibot
По запросу
4.9
mymeet.aiMymeet
По запросу
4.9
InsighterInsighter
По запросу
4.9
TGHuntTghunt
Есть бесплатный тариф
4.9
LegiscanLegiscan
По запросу
4.9
RouterAIRouterai
По запросу
4.9
Wikibot 1.0 (Викибот)Wikibot
По запросу
4.9

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8