Repository navigation
feat(commonjs): support Rollup 5 and import attributes - #2057
Merged
Merged
Conversation
Confidence Score: 5/5
[Medium impact] The reviewed changes appear safe to merge; no actionable defects were established.
|
3 of 9 tasks
TrickyPi
force-pushed
the
feat/rollup-5/commonjs
branch
from
November 28, 2026 08:53
aaaa653 to
7379118
Compare
3 of 9 tasks
lukastaegert
force-pushed
the
feat/rollup-5/commonjs
branch
from
December 3, 2026 17:25
7379118 to
2d9e138
Compare
Rollup 5 appends import attributes to module ids and passes raw ids and attributes to plugin hooks. CommonJS proxies only knew the plain id, so entry proxies threw as getModuleInfo(plainId) returned null and modules imported with attributes were loaded as a second instance. Use raw ids where an id is path shaped or user visible, pass id plus attributes where a module instance is addressed, keep them through extension resolution and repeat them on the proxy's own import so that it targets the same instance. Attributes are only stripped where an id feeds a generated variable name. Bump `@rollup/pluginutils` to `^5.6.0`, whose `createFilter` strips attributes. # Conflicts: # pnpm-lock.yaml
lukastaegert
force-pushed
the
feat/rollup-5/commonjs
branch
from
December 4, 2026 12:53
2d9e138 to
5cbca64
Compare
lukastaegert
approved these changes
Dec 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rollup Plugin Name:
commonjsThis PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
Support Rollup 5 (
^5.0.0) and import attributes in@rollup/plugin-commonjs(still compatible with Rollup 2–4).Because Rollup 5 encodes import attributes into module IDs, suffix checks like
?commonjs-es-importand proxy generation broke when a CJS module was imported with attributes. This switches those checks torawId/importerRawIdwith fallbacks for older Rollup versions, and forwards resolved import attributes through proxies,this.load,this.getModuleInfo, and extension resolution.