Recently made the upgrade to Webpack 2 because I wanted the tree shaking functionality. Took about a day. Here are some tips, along with the results.

What is Tree-Shaking?

Tree-Shaking (popularized by Rollup) is the elimination of unused exports.

Unfortunately Webpack 2’s Tree Shaking doesn’t seem to eliminate unused exports inside packages — at least in my project (eg. all of Lodash’s functions are included inside my bundle including functions I don’t use).