Skip to content

fix: exclude rolldown runtime from transform hook#178

Merged
sxzz merged 3 commits intosxzz:mainfrom
hyf0:fix/exclude-rolldown-runtime
Feb 2, 2026
Merged

fix: exclude rolldown runtime from transform hook#178
sxzz merged 3 commits intosxzz:mainfrom
hyf0:fix/exclude-rolldown-runtime

Conversation

@hyf0
Copy link
Contributor

@hyf0 hyf0 commented Feb 1, 2026

Summary

After rolldown/rolldown#8093, rolldown exposes the runtime module (\0rolldown/runtime.js) to the transform hook. The rolldown-plugin-dts transform hook transforms all JavaScript files to "export { };" when emitDtsOnly: true, which removes the runtime helpers like __exportAll, causing rolldown to panic:

Failed to resolve symbol: __exportAll

This PR adds a constant for the rolldown runtime module pattern and uses it in the transform filter's exclude list to specifically exclude the rolldown runtime module which should not be transformed.

Test plan

  • Build the plugin: pnpm build
  • Test in vite repo: Update packages/vite/package.json to point to the local build
  • Run vite build: pnpm build in vite repo - succeeds without panicking

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 1, 2026 16:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 1, 2026

Open in StackBlitz

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

commit: fc29ae1

After rolldown/rolldown#8093, rolldown exposes
the runtime module (`\0rolldown/runtime.js`) to the transform hook.
The `rolldown-plugin-dts` transform hook transforms all JavaScript files
to `"export { };"` when `emitDtsOnly: true`, which removes the runtime
helpers like `__exportAll`, causing rolldown to panic.

This commit adds a constant for the rolldown runtime module pattern and
uses it in the transform filter's exclude list.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@hyf0 hyf0 force-pushed the fix/exclude-rolldown-runtime branch from cc5703e to 18abbcc Compare February 1, 2026 17:49
@IWANABETHATGUY
Copy link

Can confirm that the vite test panic is fixed with this pr.

@sxzz sxzz merged commit e819f96 into sxzz:main Feb 2, 2026
2 checks passed
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.

4 participants