Webpack is my current module bundler.
Webpack 1 wasn’t able to parse ES2015 modules, so Babel would convert them into CommonJS. I really hated this workflow.
Webpack 2 can parse ES2015 modules, and is able to eliminate dead code based on which modules are used. Dead code removal, aka tree shaking, is reason enough for me to upgrade to Weback 2.
Webpack 2 is in beta primarily due to documentation not being finished. But documentation for Webpack has always been horrible so it really matter?
For tree shaking using webpack2, here is an excellent post you can follow along.tree shaking, webpack2
Categorized in: Web Development
This post was written by hackya