-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
fix(node-resolve): pass on isEntry flag and custom options #1016
Conversation
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.
Lgtm. Just spotted a typo
3ff83fc
to
27aa4e5
Compare
Thanks. Also fixed the package file so that only the |
Switching to "draft" as after some thought, I think I should also forward the "custom" option to "this.resolve". Will convert it back once I added this. |
27aa4e5
to
ed5b0ef
Compare
Done and again ready for review. |
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.
👍
ed5b0ef
to
ab1de1f
Compare
@@ -261,9 +260,13 @@ export function nodeResolve(opts = {}) { | |||
importer = undefined; | |||
} | |||
|
|||
const resolved = await doResolveId(this, importee, importer, opts); | |||
const resolved = await doResolveId(this, importee, importer, resolveOptions.custom); |
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.
This commit broke plugin-node-resolve, see: #1023
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.
opened #1029
Rollup Plugin Name:
node-resolve
This PR contains:
Are tests included?
Breaking Changes?
Event though I raised the rollup version used in tests, the plugin will work nicely with older Rollup versions that do not support the
isEntry
flag. In this case,isEntry: undefined
will be passed on as an option tothis.resolve
, which in turn will be ignored when the flag is not supported.List any relevant issue numbers:
rollup/rollup#4230
Description
This makes sure the plugin correctly passes on the
isEntry
flag introduced in recent Rollup versions to thethis.resolve
context function as well as thecustom
option. This will allow plugins to rely on these to e.g. resolve entry points to proxy files or do any other conditional resolving.As noted above, this is purely a bugfix and should have no adverse effect when used with older Rollup versions.