Repository navigation
fix(babel): support modules imported with attributes in Rollup 5 - #2075
Open
lukastaegert wants to merge 1 commit into
Open
lukastaegert wants to merge 1 commit into
lukastaegert wants to merge 1 commit into
Conversation
Rollup 5 appends an encoded attributes suffix to module ids. The compiler file name and sourcemap paths now use the rawId passed to the transform hook instead, so modules imported with import attributes are handled like their plain counterparts. The tests pass the attribute-encoded id together with rawId and also cover the two-argument hook call that Rollup 2-4 still uses. The plugin now requires @rollup/pluginutils ^5.6.0, whose createFilter strips the attributes suffix before matching.
lukastaegert
marked this pull request as ready for review
December 3, 2026 12:09
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no actionable issues were found. Reviews (1) · Last reviewed commit: "fix(babel): support modules imported wit..." · Reviewed by Greptile |
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:
babelThis PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
#2037
Description
This is a follow-up to the previous rollup-5 compatibility PR #2039 as we found more places that should be adjusted.
babelOptions.filenameand the userinclude/excludefilter were evaluated against the encoded id, so Babel resolved its configuration and reported errors for a file that does not exist, and**/*.jsinclude patterns did not match attributed modules.The filter now relies on
@rollup/pluginutils5.6.0, whosecreateFilterstrips the attribute suffix (the package depends on that version), and the compiler receives the raw id asfilename. The helper injection still uses the composite id, since it must match the module Rollup created.The tests assert the filename Babel receives during a build of a module imported with attributes and that an
includepattern matches it; both fail without the change.