Currently, I'm experimenting with incorporating SVG into my vue-loader/webpack template project.
I'm in need of loading different types of SVGs:
Icons: these are utilized within my components and loaded using svg-inline loader for customization with CSS.
SVGImages: used within img tags or background images loaded with url loader like other image files.
I attempted the following setup within webpack.base.conf.js:
{
test: /\.svg$/,
oneOf: [
{
resourceQuery: /ico/, // image.svg?ico,
use: 'svg-inline-loader'
},
{
resourceQuery: '/normal/',
use: 'url-loader'
}
]
}
However, I encountered an error message stating: "You may need an appropriate loader to handle this file type."
The error specifically pertains to an SVG used in a background image, while the svg inline loader appears to be functioning correctly.
Thank you for any assistance provided.