poppa / sveltekit-svg

SvelteKit plugin that makes it possible to import SVG files as Svelte components, inline SVG code or urls
MIT License
235 stars 23 forks source link

Allow to skip SVGO #20

Closed cibernox closed 2 years ago

cibernox commented 2 years ago

There are some situations where we don't want to optimize SVGs.

For instance, when SVGs are the target of CSS animations, optimization can mess things up. Also, some project just optimize SVGs statically and there's simply no point in running SVGO again on already optimized code.

I suggest that when svgOptions is explicitly set to false this library can interpret that as completely disabling the SVGO pass. We can make it with a dedicated option, but I thought that reusing this one was ok.

Let me know what you think.

poppa commented 2 years ago

Thank you for the contribution. This is a nice improvement 👍