babel-preset-optimizations
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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

Install

npm install --save-dev babel-preset-optimizations
yarn add --dev babel-preset-optimizations

Usage

Via .babelrc

.babelrc

{
  "presets": ["optimizations"]
}

Via CLI

babel script.js --presets optimizations

Via Node API

require("babel-core").transform("code", {
  presets: [require('babel-preset-optimizations')]
});

Readme

Keywords

Package Sidebar

Install

npm i babel-preset-optimizations

Weekly Downloads

301

Version

2.0.0

License

ISC

Unpacked Size

12.8 kB

Total Files

10

Last publish

Collaborators

  • churpeau