

Let's add a new utility file to our project, src/math.js, that exports two functions: If you haven't read through that guide already, please do so now. The remainder of this guide will stem from Getting Started. The new webpack 4 release expands on this capability with a way to provide hints to the compiler via the "sideEffects" package.json property to denote which files in your project are "pure" and therefore safe to prune if unused.

The webpack 2 release came with built-in support for ES2015 modules (alias harmony modules) as well as unused module export detection. The name and concept have been popularized by the ES2015 module bundler rollup. It relies on the static structure of ES2015 module syntax, i.e. Tree shaking is a term commonly used in the JavaScript context for dead-code elimination.
