Skip to content

feat!: merge emitDtsOnly and dtsInput into dtsOnly - #340

Merged
sxzz merged 6 commits into
mainfrom
merge-emit-dts-only-dts-input
Nov 4, 2026
Merged

sxzz merged 6 commits into
mainfrom
merge-emit-dts-only-dts-input

Conversation

@sxzzbot

@sxzzbot sxzzbot commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

AI usage

  • No AI was used in this PR.
  • AI was used: Claude Code + Claude Opus 5.5
    • I have carefully reviewed the AI-generated content myself.

Description

Adds a dtsOnly option for declaration-only builds, replacing emitDtsOnly and dtsInput. Entries may be source files, .d.ts files, or both.

With dtsOnly, each source entry resolves to its declaration module, so the build no longer emits a stub JS chunk and deletes it afterwards. Source modules are only loaded to provide code for the generator and stay out of every chunk.

  • emitDtsOnly and dtsInput are deprecated aliases of dtsOnly and log a warning.
  • entry cannot be combined with dtsOnly; set Rolldown input instead.
  • tsc gets all inputs as root files upfront, so it builds one program instead of one per entry.
  • Fixes declarations re-exporting JS sources with emitJs (jsdoc in js is no longer an expected failure).
  • With treeshake: false, drops imports of the Rolldown runtime from declarations: the runtime chunk import, which pointed to a removed chunk, and the createRequire import left by an inlined runtime.
  • With sideEffects: false, a declaration-only build now treats only external modules as side-effect free (moduleSideEffects: 'no-external'), so declare global in side-effect imports is kept. The setting also applies when the user sets treeshake, which previously overrode it.
  • Upgrades Rolldown to 1.2.16.

Linked Issues

Additional context

Breaking: dtsOnly with entry throws, including through the deprecated aliases. tsdown passes dts.entry together with emitDtsOnly for CJS declaration builds, so it needs to stop passing entry there before it upgrades to this release.

@pkg-pr-new

pkg-pr-new Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/sxzz/rolldown-plugin-dts@340

commit: f7aa17a

@socket-security

socket-security Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedrolldown@​1.2.15 ⏵ 1.2.169510078 +199100

View full report

@sxzz
sxzz merged commit 2858dbe into main Nov 4, 2026
14 checks passed
@sxzz
sxzz deleted the merge-emit-dts-only-dts-input branch November 4, 2026 07:23
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