

If you are interested in more ways to optimize your output, please jump to the next guide for details on building for production.Mocha AE v2 with Mocha Shape Mocha AE v2 with Mocha ShapeĪfter Effects CS4 introduced Mocha AE, an incredible planar tracking application, as an included component. In order to get rid of the dead leaves, you have to shake the tree, causing them to fall. Dead code represents the brown, dead leaves of the tree that are consumed by autumn. The source code and libraries you actually use represent the green, living leaves of the tree. You can imagine your application as a tree.

ModuleConcatenationPlugin is needed for the tree shaking to work. With minification and tree shaking, our bundle is now a few bytes smaller! While that may not seem like much in this contrived example, tree shaking can yield a significant decrease in bundle size when working on larger applications with complex dependency trees. Src/math.js export function square ( x ) n.a=r). 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.
