jpkleemans / vite-svg-loader

Vite plugin to load SVG files as Vue components
MIT License
554 stars 58 forks source link

Export only visible layers from SVG #113

Closed frederikheld closed 7 months ago

frederikheld commented 1 year ago

I'm looking for a svg loader plugin to use with vue3/nuxt3 that automatically processes my svg source file (created in Inkscape) and extracts only the visible layers, strips meta information, etc. to reduce the file size for prod.

Is this something this plugin can do? I couln't find any information about such a feature in the docs.

Thanks in advance for your response! Frederik

DirectorRen-TV commented 11 months ago

vite-svg-loader uses SVGO for SVG optimization, that includes removing meta, perhaps it also has an option to extract only visible layers, but I didnt found it. If you know algorithm, that can solve your issue, you can create and publish it as SVGO plugin

jpkleemans commented 7 months ago

You could indeed use SVGO for this