webpack

Tree Shaking

ES2015 tree shaking

webpack 2 introduces tree shaking which can remove unused code when ES2015 modules are used to import and export code.

Install

npm install babel-preset-es2015-webpack --save-dev

Usage

in .babelrc:

{
    "presets": [
        "es2015-webpack"
    ]
}

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow