Webpack 4 Adds WebAssembly Support
Written by Kay Ewbank   
Monday, 05 March 2018

Webpack 4.0 has been released with improvements including a rewritten plugin system and WebAssembly support. The new release of the JavaScript module bundler is also reported to be up to 98 percent faster.

webpacklogo

 

The improvements in performance have been reported by beta testers saw build times decrease by between 60 and 98 percent, with some builds going from nine hours to twelve minutes to build. The developers say that the performance improvements:

"also gave us the opportunity to identify some key blocking bugs in loaders and plugins that have since now been fixed."

Some of the improvements to the performance are due to the new version of the plugin system, which means that event hooks and handlers are monomorphic. Webpack has also dropped Node v4. This has, according to the developers, allowed them to add a considerable amount of newer ES6 syntax and data structures, also optimized by V8.

Extra module types have been added in the new version, alongside .mjs support. Until now, JavaScript has been the only first-class module type in Webpack, which has meant it wasn't possibly to effectively have other bundles such as CSS/HTML. The developers have in this release removed the specific JavaScript limitation, and the current API has five module types. In addition to JavaScript./auto, the new release supports EcmaScript modules; CommonJS and AMD; JSON; and WebAssembly. The developers plan future support for CSS and HTML module types.

Another useful improvement is the addition of a new config property called mode that can be set to either development or production to provide sensible defaults. In the case of production, the defaults aim to provide: 

  • Small output size.
  • Fast code at runtime.
  • Omitting development-only code.
  • Not exposing source code or file paths.
  • Easy to use output assets. 

The development option concentrates on providing: 

  • Better tooling for in-browser debugging.
  • Fast incremental compilation for a fast development cycle.
  • Better error messages at runtime.

Webpack 4 is available now on Github. 


 webpacklogo

 

 

More Information

Webpack Website

Webpack On Github

Related Articles

Next.js 5 Improves Webpack Support

TypeScript 2.7 Improves Type Inference

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Run WebAssembly Components Inside Node.js With Jco
28/03/2024

Jco 1.0 has been just announced by the Bytecode Alliance.It's a native JavaScript WebAssembly toolchain and runtime that runs Wasm components inside Node.js. Why is that useful?



Supersimple - Deep Insights From Data
02/04/2024

Announcing $2.2 Million in pre-seed funding, the Estonian startup Supersimple has launched an AI-native data analytics platform which combines a semantic data modeling layer with the ability to answer [ ... ]


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info