react-svg-loader icon indicating copy to clipboard operation
react-svg-loader copied to clipboard

Performance: Module is unreasonable huge

Open OZZlE opened this issue 6 years ago • 2 comments

It's 400 KB minified+gzipped though.. It seems like around half is babel stuff that will probably be used anyway and brough up as a top level requirement by node but 200 KB is still a lot!!

https://bundlephobia.com/[email protected] Skärmklipp 2019-10-21 11 57 59

OZZlE avatar Oct 22 '19 11:10 OZZlE

All svg files you use might not be 200 KB combined :P

OZZlE avatar Oct 22 '19 11:10 OZZlE

Tip to others before using this. If you convert inline styles to React/jsx inline styles and avoid or move <style> styling to separate css files then you could use this approach instead https://css-tricks.com/creating-svg-icon-system-react/

you might want to make it possible to send in inline style to these components also though. I guess you could make a parent component that you extend from instead of React.Component but that has many downsides also.. Not sure how you could keep the code DRY in any other way though..

OZZlE avatar Oct 22 '19 11:10 OZZlE