Skip to content

fix: preserve transform metadata in build hooks#22765

Closed
TheAlexLichter wants to merge 2 commits into
vitejs:mainfrom
TheAlexLichter:fix/preserve-rolldown-transform-meta
Closed

fix: preserve transform metadata in build hooks#22765
TheAlexLichter wants to merge 2 commits into
vitejs:mainfrom
TheAlexLichter:fix/preserve-rolldown-transform-meta

Conversation

@TheAlexLichter

@TheAlexLichter TheAlexLichter commented Jun 24, 2026

Copy link
Copy Markdown
Member

This PR fixes Vite’s build hook wrapper so adding the Vite ssr flag no longer drops non-enumerable Rolldown transform metadata like magicString.

Otherwise, https://github.com/unjs/unplugin and other consumers are not able to use them easily.

A focused regression test for Vite’s wrapper behavior is included.

@sapphi-red

Copy link
Copy Markdown
Member

I think magicString should be enumerable and should be fixed on the Rolldown side.

@TheAlexLichter

Copy link
Copy Markdown
Member Author

Will submit a fix in Rolldown then 👍🏻

hyf0 pushed a commit to rolldown/rolldown that referenced this pull request Jun 27, 2026
This is more my alley :D 

These properties should be `enumerable` (oversight that they aren't).
Otherwise they don't behave like normal JS objects and they are not
listed when spreading or using `Object.keys` (and others).

Related: vitejs/vite#22765
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