babel-preset-optimizations
Babel preset for optimizations only babel-minify plugins
Options
keepFnName
: Prevent plugin from removing function name (Enabled by default).keepClassName
: Prevent plugin from removing class name (Enabled by default).simplify
: Enable babel-plugin-minify-simplify: makes the code a lot less readable (Disabled by default).undefinedToVoid
: Enable babel-plugin-transform-undefined-to-void: in babel, undefined is considered as unpure, so undefined !== 'string' will not be simplified unless you have this plugin (Disabled by default).
Content
- babel-plugin-minify-constant-folding
- babel-plugin-minify-dead-code-elimination
- babel-plugin-minify-guarded-expressions
- babel-plugin-minify-simplify
- babel-plugin-transform-inline-consecutive-adds
- babel-plugin-transform-undefined-to-void
Install
npm install --save-dev babel-preset-optimizationsyarn add --dev babel-preset-optimizations
Usage
.babelrc
Via .babelrc
Via CLI
babel script.js --presets optimizations
Via Node API
;