OK so i am building a web app using Laravel & Vue js mainly. I tried to use https://github.com/JetBrains/svg-sprite-loader#installation but the exported svg shows up blank.
In that context before proceeding, i started wondering if this is really worth it and tbh, i am not sure.
So my question is, what is really the difference?
Let's assume we can't use icon fonts, because we want to have multicoloured svgs.
Is it even worth trying to use a package to merge the svgs into a sprite and then use it, or does it not really make a difference with http/2?
Considering file size and data usage, is it worth trying to minimise this aspect using sprite instead of multiple external svg files?
Inlining the svgs is also an option but this would dramatically increase the dom size.
So i am left wondering... has anyone tried out all these techniques and figured out the best and most performant one and what are their true differences.
Lastly if anyone would give me some input on why my svg sprite shows blank, it would be a huge bonus :P
I have configured the above package in my webpack.mix like so:
const mix = require('laravel-mix');
const SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.webpackConfig({
module: {
rules: [
{
test: /resources\/images\/.*\.svg$/,
loader: 'svg-sprite-loader',
exclude: /node_modules/,
options: {
extract: true,
spriteFilename: 'icons-sprite.svg',
publicPath: 'images/sprites/',
}
}
]
},
plugins: [
new SpriteLoaderPlugin({ plainSprite: true}) // Sprites Plugin.
],
})
.version()