I'm trying to create a Webpack loader, and all other file types are working; however, when it comes SVGs, the loader gets confused and empties the SVG image document via the font loader. Below is the code I am using...
/* Images still being loaded in this test for some reason */
{
test : /\.svg/,
exclude: '../src/images',
loader : 'file?prefix=font/'
},
{
test : /\.svg/,
include: '../src/images',
loader : 'file-loader'
}
As you can see, I have tried using include/exclude
in the tests, however, this hasn't worked.
Any ideas?
To fix this, I just used RegEx to exclude any path containing images, like so...
// FONT LOADER
{
test : /\.svg/,
exclude: [/images/],
loader : 'file?prefix=font/'
},
// OTHER FILES LOADER
{
test: /\.(mp4|ogg|svg)$/,
loader: 'file-loader'
}
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