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

better description when no exports found #4877

Closed
marzelin opened this issue May 16, 2017 · 4 comments · Fixed by #4918
Closed

better description when no exports found #4877

marzelin opened this issue May 16, 2017 · 4 comments · Fixed by #4918

Comments

@marzelin
Copy link
Contributor

marzelin commented May 16, 2017

** a feature **

What is the current behavior?

when output.pathinfo is set to true and no exports are found in a module, the module is labeled with:
/* unknown exports provided */

What is the expected behavior?
I find this message a bit misleading since it suggests that there are some exports but they are unknown for some reason. But as far as I know this message appears when webpack found no exports because there are none or it couldn't find any.

If this is a feature request, what is motivation or use case for changing the behavior?

I think that message like: /* no exports found */ would be more appropriate.

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

webpack@2.5.1

@sokra
Copy link
Member

sokra commented May 18, 2017

There could be CJS or AMD exports, but we can't detect them as CJS and AMD are dynamic and exports are only known at runtime.

@marzelin
Copy link
Contributor Author

@sokra If the file has no exports (as it often is with the main file) the message it the same /* unknown exports provided */. When I first saw it I interpreted it as if there were some malicious exports I didn't know about, but it fact the module just didn't export anything. Current description is a bit misleading and I propose to replace it with /* no static exports found */ to ease the pain for future webpack users that are not familiar with this practice.

@sokra
Copy link
Member

sokra commented May 22, 2017

/* no static exports found */

that's great. Do you want to send a PR? -> lib/FunctionModuleTemplate.js

@marzelin
Copy link
Contributor Author

Sure, I think webpack is awesome and it's a pleasure to make it even better.

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.

2 participants