[Translation] webpack 3: Official Release

· 1 min read · 324 Words · -Views -Comments

It’s finally here. And it’s beautiful.

Original: webpack-3-official-release

Since v2, we promised to ship community‑voted features on a faster, more stable cadence. After a year of betas without breaking changes between releases, we’re announcing webpack 3.0.0 — ready to download and upgrade.

npm install webpack@3.0.0 --save-dev

or

yarn add webpack@3.0.0 --dev

Upgrading from v2 should require little more than the install, though internal changes may affect some plugins. So far, 98% of users report no breaking changes.

Highlights

As promised, we’re shipping features you voted for — thanks to contributors and sponsors for making it possible.

Scope Hoisting

Webpack traditionally wrapped each module in a function, which adds overhead. Tools like Closure Compiler and Rollup “hoist” modules into a single scope for faster execution. Webpack 3 adds similar optimization.

体积大小对比

Enable it via:

module.exports = {  
  plugins: [
    new webpack.optimize.ModuleConcatenationPlugin()
  ]
};

Scope hoisting primarily targets ECMAScript modules; webpack will bail out in certain cases. Use --display-optimization-bailout to learn why a bailout occurred.

fallback

You may see a small bundle size reduction, but the bigger win is runtime performance in the browser.

Magic Comments

With dynamic import() in v2, users couldn’t name chunks like with require.ensure. Magic comments fix that — you can name chunks inline:

import(/* webpackChunkName: "my-chunk-name" */ 'module');

This shipped in 2.4/2.6 and is now stable. Dynamic imports now match require.ensure in flexibility. See the docs on code splitting: link

What’s next

Planned improvements:

  • Better build caching
  • Faster startup and incremental builds
  • Improved TypeScript experience
  • Long‑term caching
  • WASM module support
  • UX improvements

Thanks

To all users, contributors, writers, bloggers, sponsors, and maintainers — thank you. If you’d like to support the project, consider donating via Open Collective.

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover