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

hide default export warning #85

Closed
pi0 opened this issue Aug 5, 2020 · 2 comments
Closed

hide default export warning #85

pi0 opened this issue Aug 5, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@pi0
Copy link

pi0 commented Aug 5, 2020

Currently building library with default export makes this warning:

Entry module "src/module.ts" 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/module.ts" to use named exports only.

Which makes sense to use names exports however there are some packages (like nuxt modules) intentionally need default export.

@pi0 pi0 added the enhancement New feature or request label Aug 5, 2020
@danielroe
Copy link
Owner

Note that the following warning is still shown when using both which I think is fair:

Entry module "src/index.ts" is using named and default exports together. Consumers of your bundle will have to use `chunk["default"]` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning

@NazmusShakib
Copy link

Could someone please let me know if they found any solutions to this warning?

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

No branches or pull requests

3 participants