Skip to content

Remove automatic -loader module name extension #2986

Description

@jhnns

I'm submitting a feature request

Webpack version:
2.x

Current behavior:
webpack automatically appends -loader to a module when the first module lookup failed

Expected/desired behavior:
webpack should not append -loader

What is the motivation / use case for changing the behavior?
It can lead to errors that are hard to understand for newcomers. I've seen it a couple of times that webpack tried to resolve the css module as css-loader because people have just configured loader: "css". In combination with npm@3, this can be very confusing as you may have never installed the css module by yourself.

This change would probably require a lot of webpack configs to be adjusted, but since the loader configuration has been changed in webpack@2 anyway, we should include that change as well. As a downside, the config will become a little more verbose because now everyone has to write style-loader!css-loader, but I think the benefit outweighs the downside by far.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions