Skip to content

feat!: remove deprecated options, change resolveDepSubpath default, drop Node.js 25 - #1029

Merged
sxzz merged 6 commits into
mainfrom
next
Jul 26, 2026
Merged

feat!: remove deprecated options, change resolveDepSubpath default, drop Node.js 25#1029
sxzz merged 6 commits into
mainfrom
next

Conversation

@sxzz

@sxzz sxzz commented Jul 21, 2026

Copy link
Copy Markdown
Member

🚨 Breaking Changes

Deprecated tsup compatibility options removed

The following deprecated options have been removed. They were accepted (with deprecation warnings) up to v0.22.13 and now throw as unknown options:

Removed Use instead
skipNodeModulesBundle / deps.skipNodeModulesBundle deps: { neverBundle: true }
deps.onlyAllowBundle deps: { onlyBundle: [...] }
inlineOnly deps: { onlyBundle: [...] }
removeNodeProtocol nodeProtocol: 'strip'
bundle unbundle (inverted)
outExtension outExtensions
injectStyle css: { inject: true }
publicDir (and --public-dir) copy (and --copy)

deps.neverBundle: true is faster than the removed skipNodeModulesBundle (externalizes bare imports as written, without resolving them), works even when dependencies are not installed, and can be combined with deps.alwaysBundle to selectively bundle a few packages.

dts.cjsReexport removed

Dual ESM+CJS builds now always generate full .d.cts declarations via a separate compilation pass, instead of optionally emitting a .d.cts stub that re-exports from .d.mts.

deps.resolveDepSubpath now defaults to false

Subpath imports of external dependencies (e.g. my-dep/utils) are now preserved exactly as written by default. Previously, when a package had no exports field, tsdown resolved them to their actual package-relative paths (e.g. my-dep/utils.js). Set deps: { resolveDepSubpath: true } to restore the old behavior.

Node.js 25 support dropped

engines.node is now ^22.18.0 || ^24.11.0 || >=26.0.0. Node.js 25 (odd-numbered, end-of-life) is no longer supported.

Migration

Upgrading from tsdown v0.22.x: upgrade to v0.22.13 first, run your build, and resolve every deprecation warning — each warning names the replacement option. Once the build is warning-free, upgrade to this version.

Migrating from tsup: npx tsdown-migrate now installs tsdown@^0.22.13, the last version that still accepts deprecated tsup-compatible options. Migrate, resolve all deprecation warnings, then upgrade tsdown to the latest version.

Before After
skipNodeModulesBundle: true deps: { neverBundle: true }
deps: { onlyAllowBundle: [...] } / inlineOnly: [...] deps: { onlyBundle: [...] }
removeNodeProtocol: true nodeProtocol: 'strip'
bundle: false unbundle: true
outExtension: () => ... outExtensions: () => ...
injectStyle: true css: { inject: true }
publicDir: 'public' copy: 'public'
dts: { cjsReexport: true } Remove it — CJS declarations are now always fully generated
Relying on dep subpath resolution deps: { resolveDepSubpath: true }
Running on Node.js 25 Upgrade to Node.js 26+, or use 22 / 24 LTS

The still-deprecated external and noExternal options continue to work with warnings for now.

Copilot AI review requested due to automatic review settings July 21, 2026 16:25
@netlify

netlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit 10d6c93
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/6a625c0f05af3900081d7284
😎 Deploy Preview https://deploy-preview-1029--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

tsdown

pnpm add https://pkg.pr.new/tsdown@1029 -D
npm i https://pkg.pr.new/tsdown@1029 -D
yarn add https://pkg.pr.new/tsdown@1029.tgz -D

create-tsdown

pnpm add https://pkg.pr.new/create-tsdown@1029 -D
npm i https://pkg.pr.new/create-tsdown@1029 -D
yarn add https://pkg.pr.new/create-tsdown@1029.tgz -D

@tsdown/css

pnpm add https://pkg.pr.new/@tsdown/css@1029 -D
npm i https://pkg.pr.new/@tsdown/css@1029 -D
yarn add https://pkg.pr.new/@tsdown/css@1029.tgz -D

@tsdown/exe

pnpm add https://pkg.pr.new/@tsdown/exe@1029 -D
npm i https://pkg.pr.new/@tsdown/exe@1029 -D
yarn add https://pkg.pr.new/@tsdown/exe@1029.tgz -D

tsdown-migrate

pnpm add https://pkg.pr.new/tsdown-migrate@1029 -D
npm i https://pkg.pr.new/tsdown-migrate@1029 -D
yarn add https://pkg.pr.new/tsdown-migrate@1029.tgz -D

commit: 10d6c93

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a set of breaking configuration and platform changes across tsdown’s dependency handling and DTS generation pipeline, aligning runtime behavior, tests, and documentation with the removal of long-deprecated options.

Changes:

  • Removed deprecated dependency options (skipNodeModulesBundle, deps.skipNodeModulesBundle, deps.onlyAllowBundle) and updated dependency subpath resolution default (resolveDepSubpath: false).
  • Removed dts.cjsReexport and switched dual ESM+CJS declaration output to always use a full CJS DTS pass.
  • Dropped Node.js 25 support by tightening engines.node and updated docs/tests/snapshots accordingly.

Reviewed changes

Copilot reviewed 28 out of 31 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/issues.test.ts Migrates tests off removed deps/DTS options.
tests/e2e.test.ts Updates resolveDepSubpath tests and removes cjsReexport e2e.
tests/snapshots/resolve-dep-subpath-without-exports-field/skipNodeModulesBundle-should-preserve-dep-file-when-resolveDepSubpath-is-false.snap.md Removes snapshot for deleted skipNodeModulesBundle scenario.
tests/snapshots/resolve-dep-subpath-without-exports-field/skipNodeModulesBundle-dep-folder-should-resolve-to-dep-folder-index-js.snap.md Removes snapshot for deleted skipNodeModulesBundle scenario.
tests/snapshots/resolve-dep-subpath-without-exports-field/skipNodeModulesBundle-dep-file-should-resolve-to-dep-file-js.snap.md Removes snapshot for deleted skipNodeModulesBundle scenario.
src/features/rolldown.ts Removes cjsReexport integration and updates type import path.
src/features/deps.ts Removes deprecated deps options + changes resolveDepSubpath default.
src/features/deps.test.ts Updates unit tests for new resolveDepSubpath default/behavior.
src/features/cjs.ts Removes the CJS DTS re-export plugin implementation.
src/config/types.ts Removes dts.cjsReexport and deprecated config fields from types.
src/build.ts Always runs a CJS DTS-only pass when dts is enabled for CJS.
skills/tsdown/references/reference-cli.md Removes CLI docs for deleted --deps.skip-node-modules-bundle.
skills/tsdown/references/option-dependencies.md Removes docs for deleted deps options and updates migration section.
skills/tsdown-migrate/SKILL.md Updates migration guidance to reflect removals.
skills/tsdown-migrate/references/guide-differences-detailed.md Updates migration guidance to reflect removals.
packages/migrate/package.json Updates Node engine range to exclude Node 25.
packages/exe/package.json Updates Node engine range to exclude Node 25.
packages/css/package.json Updates Node engine range to exclude Node 25.
packages/create-tsdown/package.json Updates Node engine range to exclude Node 25.
package.json Updates Node engine range; bumps inlined package-manager-detector.
docs/zh-CN/reference/cli.md Removes CLI docs for deleted --deps.skip-node-modules-bundle.
docs/zh-CN/options/dependencies.md Updates resolveDepSubpath docs/default and removes skipNodeModulesBundle section.
docs/zh-CN/guide/migrate-from-tsup.md Adjusts migration tables for removed options.
docs/zh-CN/guide/how-it-works.md Clarifies resolveDepSubpath is optional.
docs/reference/cli.md Removes CLI docs for deleted --deps.skip-node-modules-bundle.
docs/options/dependencies.md Updates resolveDepSubpath docs/default and removes skipNodeModulesBundle section.
docs/guide/migrate-from-tsup.md Adjusts migration tables for removed options.
docs/guide/how-it-works.md Clarifies resolveDepSubpath is optional.
snapshots/tsnapi/plugins.snapshot.d.ts Updates public API snapshot for DepsPlugin signature.
snapshots/tsnapi/index.snapshot.d.ts Updates public API snapshot for removed options/types and exports.
snapshots/tsnapi/config.snapshot.d.ts Updates public API snapshot for removed config fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/features/deps.ts Outdated
Comment on lines +114 to +118
@@ -128,8 +115,7 @@ export function resolveDepsConfig(
alwaysBundle,
onlyBundle,
onlyImport,
skipNodeModulesBundle,
resolveDepSubpath = true,
resolveDepSubpath = false,
Comment thread src/features/rolldown.ts
Comment on lines 129 to 133
if (dts) {
const { dts: dtsPlugin } = await import('rolldown-plugin-dts')
const { cjsReexport: _, ...dtsPluginOptions } = dts
const options: DtsOptions = {
tsconfig,
logger,
@sxzz
sxzz force-pushed the next branch 4 times, most recently from 4d4e43b to afaf188 Compare July 21, 2026 17:14
@sxzz
sxzz force-pushed the main branch 3 times, most recently from 4a1166d to 0525465 Compare July 23, 2026 18:06
sxzz added 6 commits July 24, 2026 03:23
The CJS re-export stub option has been removed.
Dual-format builds always run a separate CJS
declaration pass again.

Related: #944 (comment)
Use `deps.neverBundle: true` instead, which externalizes all
dependencies. tsup configs are migrated automatically by
`tsdown-migrate`.
Remove `inlineOnly`, `removeNodeProtocol`, `bundle`, `outExtension`,
`injectStyle`, `publicDir` and the `--public-dir` CLI flag.
tsdown-migrate now pins migrated projects to tsdown@^0.22.13, the last
version accepting these options, so tsup users can resolve deprecation
warnings before upgrading.
@sxzz
sxzz merged commit 507661c into main Jul 26, 2026
17 checks passed
@sxzz
sxzz deleted the next branch July 26, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants