iest / babel-plugin-inline-svg

Babel plugin to optimise and inline svg
49 stars 15 forks source link

feat: option to generate a data-uri inlined svg #23

Closed arpontes closed 3 years ago

arpontes commented 4 years ago

I suggest a new option, inlineInImgSrc, that will put a data uri image prefix and convert to base64 for direct use in an img src property.

arpontes commented 3 years ago

Hello, @iest! I did the changes! Feel free to criticize! :-)

arpontes commented 3 years ago

@iest , I did the suggested changes. In the case of the test, just the EOL reference isn't enough, since the raw expected value have escaped EOL. So, I just escaped the os-based EOL variable.

iest commented 3 years ago

Greats stuff @arpontes!

Shame that the EOL stuff was a bit more complicated, but the tests pass so I guess it's worth it.

Thanks again, I'll get this released soon 🚀

iest commented 3 years ago

Voilá! https://github.com/iest/babel-plugin-inline-svg/releases/tag/v1.2.0