diegohaz / arc

React starter kit based on Atomic Design
https://arc.js.org
2.92k stars 292 forks source link

Working collection of bundle-shaving tips #336

Open vegeta897 opened 6 years ago

vegeta897 commented 6 years ago

After including lodash-webpack-plugin and babel-plugin-lodash in .babelrc and webpack.config.js with no extra configuration, my build time went down by ~2 seconds and vendor file shrunk from 538 kB to 504 kB

Small, but figured it was worth sharing!

Related to #290

Edit: It was mentioned in #313 that lodash was already being trimmed by using /function in the imports, but I guess these packages do some extra work on top of that.

Edit: When using redux-form I saved 31kb more by using babel-plugin-transform-imports as described here.

I've renamed this issue so I can continue sharing any more optimizations I find :)