-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Resolve import.meta.{filename,dirname} in files imported from config #5520
Conversation
…ranspiled config files
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5520 +/- ##
=======================================
Coverage 98.81% 98.81%
=======================================
Files 238 238
Lines 9540 9544 +4
Branches 2437 2439 +2
=======================================
+ Hits 9427 9431 +4
Misses 48 48
Partials 65 65 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
This PR has been released as part of rollup@4.18.0. You can test it via |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers: N/A
Description
Back in #4005, rollup was taught how to resolve
import.meta.url
in files imported into the rollup config using a relative path - makingimport.meta.url
refer the file it's used in, rather than the config file.node 20.11.0 introduced two new import meta fields -
import.meta.filename
andimport.meta.dirname
- that act the same as __filename and __dirname in commonjs.This PR teaches rollup config transpilation how to transform
import.meta.filename
andimport.meta.dirname
so they behave as expected inside plugins that are imported via relative paths. Previously, import.meta.filename and import.meta.dirname would be the file/directory of the config file.