-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Add notice / warning when build fails and resolve.extensions is missing a leading dot, (developer experience improvement) #11695
Comments
Send a PR Here is similar code and also the place where this need to be added: webpack/lib/NormalModuleFactory.js Lines 678 to 724 in 27796db
|
Add a warning while user configured resolve.extensions without a leading dot (e.g. ["js", "jsx"]), and a module resolution fails because of that
Add a warning while user configured resolve.extensions without a leading dot (e.g. ["js", "jsx"]), and a module resolution fails because of that
Add a warning while user configured resolve.extensions without a leading dot (e.g. ["js", "jsx"]), and a module resolution fails because of that
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Bump |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
Feature request
The name of the configuration
resolve.extensions
is not clear enough about the fact that the extensions should start with.
(e.g.['.js', '.jsx']
and not['js', 'jsx']
)The docs are OK, and this is quite a silly thing - until you find yourself trying to review every piece of a webpack config file for errors and keep getting failed builds
What is the expected behavior?
When a build fails (to prevent warning in cases where the extension shouldn't start with a dot) - if one of the extension in the configuration
resolve.extensions
does not start with a dot - show a warning or a hint (something like -Did you mean
'.js'instead of
'js'in resolve.extensions?
I'm not familiar enough with the guts of webpack, but, if it is also possible to check whether this change would have fix the issue that caused the build fail - be more explicit with the warning (e.g. when a resolver fails to find a file with listed extension - try adding dot if it is missing, and if it finds a file - show a more specific warning about that).
What is motivation or use case for adding/changing the behavior?
I just lost 1.5 hours debugging a webpack configuration, and after remove and installing every plugin/loader that I installed million times - I realised that this **** dot was the problem (though the error didn't suggest anything close to that)
How should this be implemented in your opinion?
In a developer friendly way!
see response for "What is the expected behavior?"
Are you willing to work on this yourself?
yes, but I will probably need some guidance about where to start
The text was updated successfully, but these errors were encountered: