Tricks to minimize React.js build file size
Zhe Chen
793

Nice article.

I recently faced issues with bundle size and read a lot in depth for what was going wrong. Apart from Webpack config changes and using plugins, you can actually reduce your bundle size by including only the react components (from library) needed by your component/code rather than the whole library.
Say, I was using recharts module to build visualisations. I was using Piecharts only. Initially I had included the component as `import PieChart from ‘recharts’`. I changed it to, `import PieChart from ‘recharts/lib/chart/PieChart’`. And similarly found code which was being affected in similar manner.

This tremendously brought down my bundle size.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.