-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
node-resolve
plugin no longer supports "default" require import
#402
Comments
Thanks for opening an issue. Citing the issue template:
Please add a reproduction and we'll be happy to triage further. |
Reproduction through repl.it https://repl.it/@alexlafroscia1/UnsightlyAliceblueExternalcommand |
Looks like this is expected. Changelog contains notes which address this: https://github.com/rollup/plugins/blob/master/packages/node-resolve/CHANGELOG.md#v800 |
I guess so. As a user, it seems pretty weird that ESM supports a default export but Node does not. Especially when all of the documentation shows usage of the default export. |
I'll close this, as the change seems intentional. The changelog entries just make this pretty hard to notice
Especially when ESM still does support a default. You have to do a fair amount of digging to find out that just the node usage changed. |
You're of course welcome to that observation, but I would disagree that it takes a fair amount. It takes a normal/expected amount for major versions imho. |
Just to add a note, given the changelog I was a bit confused at first when looking at this today since I am using ESM via a - import nodeResolve from '@rollup/plugin-node-resolve';
+ import nodeResolvePlugin from @rollup/plugin-node-resolve';
+ const { nodeResolve } = nodeResolvePlugin; |
node-resolve
v8.0.0
1.25.2
(throughbroccoli-rollup
)12.16.2
How Do We Reproduce?
https://repl.it/@alexlafroscia1/UnsightlyAliceblueExternalcommand
Expected Behavior
The plugin function would be accessible by requiring
@rollup/plugin-node-resolve
Actual Behavior
The package no longer has a "default export" of the plugin function when importing through Node rather than ESM. While configuring Rollup directly supports the ESM style, configuring Rollup i
indirectly (like in our case, through the Broccoli wrapper plugin) does not.
Since the default ESM export is a function, I would expect the same to be true when requiring it in Node.
The text was updated successfully, but these errors were encountered: