-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Add notice / warning when build fails and resolve.extensions is missing a leading dot, (developer experience improvement) #11695
Description
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