gilbarbara/react-inlinesvg

Is it possible to reduce bundle size?

andrey-skl opened this issue · 2 comments

I really like the library thank you!
But currently react-inlinesvg size is about 8Kb gzip which is kind of big for functionality it covers.

Isn't it possible to reduce it?

Not really. Do you have any suggestion?
You can stick with 0.8.4 if it works for you or use @svgr/webpack to convert SVGs to React components.

I had a lot of issues about the string approach used in the previous version so I had to upgrade it to use a DOM conversion instead. Most of the bundle size increase came from that.

I made some optimizations in the react-from-dom dependency and removed another one.
Yarn registry is outdated so bundlephobia isn't showing 1.1.5 yet but I think I shaved off about 1kb gzipped.
Nothing much else I can't do for now.

Thanks