webpack 4 doesn’t allow to use different loaders depending on issuer

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Declaring multiple loaders with same test but different issuer stopped working in webpack 4

If the current behavior is a bug, please provide the steps to reproduce.

See https://github.com/Hypnosphi/webpack-issuer-repro
Note the duplicate keys ./circle.svg https://github.com/Hypnosphi/webpack-issuer-repro/blob/master/dist/main.js#L27-L47

What is the expected behavior?

a.js should get base64-encoded string, and b.js should get the file reference

Author: Fantashit

2 thoughts on “webpack 4 doesn’t allow to use different loaders depending on issuer

  1. Seems like the NamedModulesPlugin doesn’t handle conflicts.

    As workaround you can disable it via optimization.namedModules: false

  2. Also hit this issue FYI to people who might be using SVG loaders and loading the same svg file with different svg-loaders.

Comments are closed.