tsdown
Use this skill when work touches tsdown: library builds, tsdown.config, dts/exports, dependency externalization, watch/unbundle, CSS/plugins/workspace, or migrating from tsup.
Workflow
- Inspect the local tsdown surface:
- Package version (
tsdown@0.22.x preferred; snapshot 0.22.14). Node to run the tool: ^22.18.0 || >=24.11.0.
- Config:
tsdown.config.ts / package.json#tsdown; peers (typescript, @tsdown/css, publint, …).
package.json type, exports, types, engines.node (feeds target/dts auto-detect).
- Whether migrating from tsup (
external, entryPoints, bundle: false, …).
- For day-to-day how-to, follow usage-guide.md first.
- Refresh docs when versions drift (especially 0.23 beta). Start from source-map.md.
- Route deeper detail:
- Config/CLI/defaults: config-cli.md.
- dts, package exports, deps: dts-exports-deps.md.
- Plugins, CSS, copy, workspace, programmatic: plugins-css-workspace.md.
- tsup migration: migrate-from-tsup.md.
- Prefer current APIs:
entry, deps.neverBundle / alwaysBundle, unbundle, copy, cjsDefault. Treat CJS as maintenance; prefer ESM-only for new libraries.
- Verify with
bunx tsdown (or project build), check dist + exports/types, then consume the package from a smoke import.
Core Judgment
- tsdown = library bundler on Rolldown + Oxc — spiritual successor to tsup, not an app bundler.
- Defaults differ from tsup:
format: 'esm', clean: true, dts often auto from package.json types/exports, target from engines.node.
- Prefer
deps.neverBundle / alwaysBundle over deprecated external / noExternal.
- Default dep policy: package dependencies/peers are externalized; used devDependencies may be bundled — override with
deps when wrong.
- Install
typescript for dts (unless oxc fast path via isolatedDeclarations).
@tsdown/css / @tsdown/exe must match the tsdown version when used.
- No stub mode — use
--watch and/or exports.devExports.
- Code splitting is always on — no
splitting: false.
- Pin skill guidance to 0.22.14 unless the project is on 0.23 beta; clear deprecations on 0.22 before jumping to 0.23.
- Prefer
bun / bunx in command examples.
Verification
Prefer repository-owned commands. For meaningful tsdown work, cover the relevant subset:
bunx tsdown --version and confirm Node engine for the CLI.
- Clean build:
bunx tsdown / bun run build; inspect dist formats and extensions (.mjs/.cjs/.js).
- Types: consume
.d.ts / exports.types from a dependent package or tsc.
- Dual-format: require + import smoke when
format includes both.
- After
exports: true: validate package.json with publint/attw if enabled.
- Migration: zero deprecation warnings on 0.22 before upgrading to 0.23+.
Report which checks ran, which did not, and any version assumptions that remain.
1---2name: tsdown3description: Build, review, debug, configure, migrate, teach, or plan tsdown library bundling with current docs and a full usage guide. Use for tsdown, tsdown.config, defineConfig, entry, format esm/cjs, dts, deps.neverBundle/alwaysBundle, exports, unbundle, watch, minify, target, platform, copy, CSS (@tsdown/css), plugins, workspace, programmatic build(), and tsup to tsdown migration.4---56# tsdown78Use this skill when work touches tsdown: library builds, `tsdown.config`, dts/exports, dependency externalization, watch/unbundle, CSS/plugins/workspace, or migrating from tsup.910## Workflow11121. Inspect the local tsdown surface:13 - Package version (`tsdown@0.22.x` preferred; snapshot **0.22.14**). Node to **run** the tool: `^22.18.0 || >=24.11.0`.14 - Config: `tsdown.config.ts` / `package.json#tsdown`; peers (`typescript`, `@tsdown/css`, `publint`, …).15 - `package.json` `type`, `exports`, `types`, `engines.node` (feeds target/dts auto-detect).16 - Whether migrating from tsup (`external`, `entryPoints`, `bundle: false`, …).172. For day-to-day how-to, follow [usage-guide.md](references/usage-guide.md) first.183. Refresh docs when versions drift (especially **0.23 beta**). Start from [source-map.md](references/source-map.md).194. Route deeper detail:20 - Config/CLI/defaults: [config-cli.md](references/config-cli.md).21 - dts, package exports, deps: [dts-exports-deps.md](references/dts-exports-deps.md).22 - Plugins, CSS, copy, workspace, programmatic: [plugins-css-workspace.md](references/plugins-css-workspace.md).23 - tsup migration: [migrate-from-tsup.md](references/migrate-from-tsup.md).245. Prefer current APIs: `entry`, `deps.neverBundle` / `alwaysBundle`, `unbundle`, `copy`, `cjsDefault`. Treat CJS as maintenance; prefer ESM-only for new libraries.256. Verify with `bunx tsdown` (or project `build`), check `dist` + `exports`/types, then consume the package from a smoke import.2627## Core Judgment2829- tsdown = **library bundler** on **Rolldown + Oxc** — spiritual successor to tsup, not an app bundler.30- Defaults differ from tsup: **`format: 'esm'`**, **`clean: true`**, dts often **auto** from `package.json` types/exports, target from **`engines.node`**.31- Prefer **`deps.neverBundle` / `alwaysBundle`** over deprecated `external` / `noExternal`.32- Default dep policy: package **dependencies/peers** are externalized; used **devDependencies** may be bundled — override with `deps` when wrong.33- Install **`typescript`** for dts (unless oxc fast path via `isolatedDeclarations`).34- `@tsdown/css` / `@tsdown/exe` must **match** the `tsdown` version when used.35- No stub mode — use `--watch` and/or `exports.devExports`.36- Code splitting is always on — no `splitting: false`.37- Pin skill guidance to **0.22.14** unless the project is on 0.23 beta; clear deprecations on 0.22 before jumping to 0.23.38- Prefer **`bun` / `bunx`** in command examples.3940## Verification4142Prefer repository-owned commands. For meaningful tsdown work, cover the relevant subset:4344- `bunx tsdown --version` and confirm Node engine for the CLI.45- Clean build: `bunx tsdown` / `bun run build`; inspect `dist` formats and extensions (`.mjs`/`.cjs`/`.js`).46- Types: consume `.d.ts` / `exports.types` from a dependent package or `tsc`.47- Dual-format: require + import smoke when `format` includes both.48- After `exports: true`: validate `package.json` with publint/attw if enabled.49- Migration: zero deprecation warnings on 0.22 before upgrading to 0.23+.5051Report which checks ran, which did not, and any version assumptions that remain.