New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow import.meta.* instead of only import.meta.url #3151
Comments
I see your point and it definitely makes sense to have a fallback for other properties. I think a prudent change could be to reverse the if statement: If none of the special cases internal to Rollup are encountered, then ALWAYS add the additional accessed globals. |
PR welcome, I added additional notes to the issue description. |
I have created the PR to initiate the work. It would match my need but I'm not very confortable with 'use strict';
undefined('./foo.js'); being the expected output for commonjs format 😅 |
See my comment on your PR, I think it is a reasonable compromise. |
People can still change this by implementing |
resolved via #3152 |
Thank you very much 😍 |
I found that if you just use Is this a bug? |
Actually a bug. Fix here: #3282 |
Expected Behavior / Situation
I would like that the following code
To output something like this for systemjs format.
Actual Behavior / Situation
The output has no
module
, resulting in a ReferenceError: module is not defined.Modification Proposal
Make this if less strict.
rollup/src/ast/nodes/MetaProperty.ts
Line 39 in 8df2bc1
Adding
|| metaProperty === 'resolve'
works for me.Note by maintainers (by @lukastaegert)
🙋♀️ Want to get involved and address this? This issue is likely easy to address and a good starting point to get familiar with the Rollup code base.
The proposed solution is to reverse the linked if statement so that all non-Rollup-internal cases are handled like the generic URL case. It should probably be checked if this assumption makes sense for all formats.
As a test, adding one to the
form
directory would make sense, as these render the code in all available formats. Look at the other tests how those are written. To validate the code is actually runnable, it could make sense to also add a test to thefunction
directory as those tests compile to CommonJS and actually run the code, but this is optional.The text was updated successfully, but these errors were encountered: