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
Improve absolute path handling #4021
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4021 +/- ##
=======================================
Coverage 97.47% 97.47%
=======================================
Files 192 192
Lines 6775 6785 +10
Branches 1985 1994 +9
=======================================
+ Hits 6604 6614 +10
Misses 84 84
Partials 87 87
Continue to review full report at Codecov.
|
1a0dbe7
to
72ff786
Compare
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via
or load it into the REPL: |
72ff786
to
e7f6901
Compare
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.
?
While the question is rather vague, the answer to the three "fixed" issues is to add |
Looks like they made a breaking change in a minor release: rollup/rollup#4021
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Resolves #3940
Resolves #3693
Resolves #3024
Description
This will very much extend the handling of external imports to allow having absolute external imports in the output. There are several parts to this:
A new option
makeAbsoluteExternalsRelative
that controls how absolute resolved ids are handled. By default it istrue
, which is the current behaviour. Switching it tofalse
will keep them as absolute in the output while the third value"ifRelativeSource"
will only convert them to a relative import if the original import has been relative (even though the resolved import might not have anything to do with the original import)."IfRelativeSource"
will become the new default in the next major versionAn extension of the
resolveId
plugin hook: When plugins return an object for theirresolveId
hook, they can now not only make the id "external" by returningexternal: true
, they can also override the user's choice for themakeAbsoluteExternalsRelative
option. By returningexternal: "absolute"
, they can force an absolute id to remain absolute in the output while by returningexternal: "relative"
, they can force it to become relative. For non-absolute ids, these choices will be treated astrue
.A new value for the
external
property when using thethis.resolve
plugin context function. When an absolute id should opt out of becoming relative, theexternal
property will have the value"absolute"
instead oftrue
. While this could be considered a breaking change, this will only happen if either the user or a plugin makes use of the new option. For that reason, this will still be a minor release.See also the included doc updates.