The future of bundling JavaScript modules

This blog post examines how the bundling of modules is affected by two future developments: HTTP/2 and native modules.


Tree-shaking with webpack 2 and Babel 6

Rich Harris’ module bundler Rollup popularized an important feature in the JavaScript world: tree-shaking, excluding unused exports from bundles. Rollup depends on the static structure of ES6 modules (imports and exports can’t be changed at runtime) to detect which exports are unused.

Tree-shaking for webpack is currently in beta. This blog post explains how it works. The project we are going to examine is on GitHub: tree-shaking-demo

Installing past or future versions of npm packages

npm lets you install versions of packages other than the current one, via:

    npm install «package-name»@«tag»
    npm install «package-name»@«version»


Why is (0,obj.prop)() not a method call?

This blog post explores references, a mechanism used by the ECMAScript language specification to explain the difference between the following two expressions:

    (0, obj.prop)()


Babel and CommonJS modules

This blog post examines how Babel ensures that code it transpiles interoperates properly with normal CommonJS modules. Consult chapter “Modules” in “Exploring ES6” for more information on ES6 modules.


Babel 6: loose mode

Babel’s loose mode transpiles ES6 code to ES5 code that is less faithful to ES6 semantics. This blog post explains how that works and what the pros and cons are (spoiler: normally not recommended).


Babel 6: configuring ES6 standard library and helpers

This blog post is outdated. Please read Chap. “Babel: configuring standard library and helpers” in “Setting up ES6”.

This blog post explains how to configure how Babel 6 accesses its own helper functions and the ES6 standard library.