When I have a loader configuration with multiple tests matching a file, I would expect only the first matching loader to be used but that doesn't seem to be the case.
I tried reading the source but even when I found the bit that I think implements the loading I can't understand how it behaves.
The documentation doesn't mention how that situation should behave either.
Yes, although I like to avoid that because then you cannot decide at build time if the file should be a link or embedded. You can also start with !! to skip any other loaders BTW…
Webpack goes through all the import ed and require d files in your project, and for all those files which have a . svg extension, it uses as an input to the webpack file loader. For each of these files, the file loader emits the file in the output directory and resolves the correct URL to be referenced.
There are four basic concepts in webpack: entry , output , modules and plug-ins . These configurations are added in webpack.
{ test: /\.css$/, loaders: ['style'], }, { test: /\.css$/, loaders: ['css'], },
and
{ test: /\.css$/, loaders: ['style', 'css'], },
appear to be equal. In function terms, this is the same as style(css(file))
(thanks Miguel).
Note that within loaders
they are evaluated from right to left.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With