DEV Community

Discussion on: 5 Good practices to scale your React projects easily

Collapse
 
edmundo096 profile image
Edmundo Elizondo • Edited

As far I understand, this practice assumes a configured tree shaking on a package bundler.
I have seen sites where unused components and even tests files are still referenced from the index file (and downloaded).
Well configured, it leaves less and shorter imports.

Thread Thread
 
jeffreythecoder profile image
Jeffrey Yu

Yes Edmundo, tree shaking strictly bundles only explicitly exported modules and avoids unnecessary ones. I believe it's an essential practice for good production build. I also use lighthouse to scan and optomize.