By default, Vue Cli uses file-loader
for SVG assets. However, I want to use svg-sprite-loader
and a few other loaders instead.
I have made changes to the vue.config.js
file in order to achieve this, but it seems like the configuration is not being applied at all.
vue.config.js
module.exports = {
configureWebpack: {
module: {
rules: [
{
test: /\.(svg)(\?.*)?$/,
use: [
{
loader: 'svg-sprite-loader',
options: {
name: '[name]-[hash:7]',
prefixize: true
}
},
'svg-fill-loader',
'svgo-loader'
]
}
]
}
}
}
Can anyone spot any issues with my setup?
I am still experiencing the problem where SVG files are being imported into my component as URL strings or paths rather than objects with properties.
Thank you in advance!