Skip to content
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

Warning when using a default export #425

Open
chocolateboy opened this issue Jul 31, 2020 · 0 comments · May be fixed by #426
Open

Warning when using a default export #425

chocolateboy opened this issue Jul 31, 2020 · 0 comments · May be fixed by #426

Comments

@chocolateboy
Copy link
Contributor

chocolateboy commented Jul 31, 2020

Bili: v5+ | Node.js: v14.6.0 | OS: Linux (Arch)

Using a default export in an ES module results in the following warning, as of Rollup v2.2.0 (PR):

warning prefer_named_exports: Entry module "src/index.js" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "src/index.js" to use named exports only.

This isn't something that needs to be "fixed" in modules which only use default exports (i.e. which don't mix named and default exports), and developers shouldn't have to change their API to appease a bundler, so the warning should not be enabled by default.

Note: the warning is disabled by default in Rollup (it's set to auto). It's only because Bili provides a custom output config (which hasn't been updated to reflect this change) that the default setting isn't used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant