Seems as though the loader stips ID's from paths? Or am I doing something wrong? :)
Thanks
@jdfx: You're not doing anything wrong. That is the default setting.
@visualfanatic: Are you still actively maintaining this? If not, I'm going to fork and resolve @jdfx problem.
I have been browsing around this repo and it seems it's not currently possible to pass svgo options to the loader to override the defaults. Is this true @visualfanatic?
...And is this what you were planning on resolving @choskim?
@choskim that would be amazing. Stripping ID's renders the loader useless to me as I am working with animated svg's using gsap etc which references those id's heavily.
If you have any luck please do let me know or I could have a go at tackling it myself (badly probably!)
For now I am having to render the SVG's as static assets but this does feel very un-webpack like
@jdfx I've submitted a pull request that essentially does what @choskim was hinting at by implementing svgo options into the loader. You're welcome to test it out in your setup and give your feedback. Should be much more "webpack like". Usage is just like other similar loaders out there that implement svgo:
{
loader: 'vue-svg-loader',
options: {
svgo: {
plugins: [
{removeDoctype: true},
{removeComments: true},
{cleanupIDs: false}
]
}
}
}
@matpeder Amazing! The way I've beeen loading SVG's into Vue has really been bugging me, thanks. I will test this out asap.
Sorry for this super delay, I had zero free time for the last three months. I merged @matpeder PR, so you can just update vue-svg-loader to v0.3.0 and copy the code snippet that @matpeder shared. Let me know if you still have issues after doing that.
Most helpful comment
@jdfx I've submitted a pull request that essentially does what @choskim was hinting at by implementing svgo options into the loader. You're welcome to test it out in your setup and give your feedback. Should be much more "webpack like". Usage is just like other similar loaders out there that implement svgo: