π webpack 2 and beyond π
The road ahead
Today weβve published webpack 2 to npm under the latest
tag on npm! You can install it in your project using npm install webpack
.
π Why Update? π
The upgrade from webpack 1 to 2 comes with some very exciting features.
π ES6 Support π β
You no longer have to use babel to transpile import
and export
statements in your code. webpack now supports parsing of these statements. This allows us to leverage a new webpack 2 feature: βTree shakingβ!!
Tip: If you are using Babel to convert import
and export
statements to require
statements, you can now turn this off with modifying using the preset options. We recommend the env
preset to handle this for you.
["env", {"modules": false}]
See more about this in Babelβs documentation!
π³ Tree shaking π³
Because ES6 import
and export
are statically analyzed, webpack can βmarkβ unused imports
and allow minifiers such as UglifyJs, and Closure Compiler to remove the unused code. This may result in much smaller bundles! (Known as dead code elimination) β Click here for more info!
π module.loaders => module.rules π
We have made significant improvements in flexibility and configuration for loaders. This includes being able to pass functions into the `options` property, a new filter known as issuer
, and also the ability to constrain the webpack parser on a per-loader basis to decrease build times, and enforce module consistency. Click here for more info!
π Performance Budgets π
We joined forces with Addy Osmani to create Performance budgets. Now by default, webpack will highlight bundles that exceed 250kb in size. You can read in detail how and why we love this feature. Click here for more info!
π And so much more π
This is just some of the top features. Weβve also improve our resolver, build speeds, loader API, support for the new whatwg loader
spec to lazy load bundles using import()
, and so much more!! Take a look at our migration guide to see all the changes!
π£ The Road Ahead π£
There are so many exciting things happening that weβd like to share with you. First is our current and future milestones that we are planning.
ππ‘ The Bugfix Release ππ‘
As of our final release, we are in the webpack 2.3 Bugfix Milestone. We will fix any critical issues that have been reported from the community updating to webpack 2. We ask that when you submit issues, remember to provide a reproducible example so that we can expedite the fixing process. After this milestone is finished we will publish those fixes for you and move on to our Feature Releases.
π The Feature Releases π
The feature milestones represent the enhancements that you have chosen! Since we published our Vote page, the battle between adding Rollup-style scope hoisting and better tree shaking support for TypeScript has been neck and neck. Once weβve shipped our bugfix release, we will take the feature with the most votes and assign it to our 2.4 milestone and start development on it.
π And much more!!! π
We have lotβs of exciting things down the pipeline but we donβt want to spoil it all for you!!! Stay tuned for more updates.
No time to help contribute? Want to give back in other ways? Become a Backer or Sponsor to webpack by donating to our open collective. Open Collective not only helps support the Core Team, but also supports contributors who have spent significant time improving our organization on their free time! β€