soska / savagejsx

Utility to convert svg to react components
5 stars 0 forks source link

Svgo Integration #1

Open jonambas opened 6 years ago

jonambas commented 6 years ago

Thoughts on integrating a tool such as svgo? Just an idea.

SVG files from most editors contain a lot of useless code - comments, metadata, hidden elements, etc. UI showcasing its capabilities: https://jakearchibald.github.io/svgomg

I also think it'd be useful to paste markup, in addition to uploading an svg file. 😊

nitishkr88 commented 6 years ago

I'm not sure if this can be done due to limitation of svgo to be used at the browser side. See the below issue. Looks like it is closed but not yet implemented.

https://github.com/svg/svgo/issues/518

soska commented 5 years ago

Sorry for the late update.

So I tried and it is indeed too much work or almost impossible to integrate SVGO. Those are the bad news, but, we are already doing some optimizations that come for free with the svg-to-jsx package and I think it would be trivial to add more if only svg-to-jsx accepted some kind of plugins.

cancerberoSgx commented 5 years ago

I think it should be possible to run svgo (or parts of it) in the browser, check https://github.com/svg/svgo/issues/1050 and https://github.com/jakearchibald/svgomg/issues/88#issuecomment-290986043