url-loader is encoding path instead of image #43
Comments
If I force the loader, it works correclty: const tickImg = require('!!url!../assets/tick.svg');
... |
Here's my webpack loaders configuration: {
test: /\.(png|svg)$/,
loader: 'url',
query: {
limit: 10000,
},
}, {
test: /\.(png|jpg|svg)$/,
loader: 'file',
query: {
name: 'assets/images/[name]-[sha512:hash:base64:7].[ext]',
},
} |
@romulof It is probably encoding the path instead of the url because you have 2 loaders for the same file:
The solution is to use a single loader, similar to:
|
@julienevano, I'm not chaining the loaders. I have 2 distinct tests, one with I'm not sure about how How do you |
Oh, I just read the code!
|
I guess the problem lies in the documentation, because if I read:
https://webpack.js.org/loaders/url-loader/#usage and even if I read about the
I'm still not fully aware that I need to remove |
I have the same issue in SCSS files. When the file size exceeds the limit, Did you find any solution? |
Results in inline-style:
Decoding the base64 string:
The text was updated successfully, but these errors were encountered: