# babel-preset-babili

> Babel preset for all minify plugins.

Latest version **0.1.4** (published 2017-06-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install babel-preset-babili
pnpm add babel-preset-babili
yarn add babel-preset-babili
bun add babel-preset-babili
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2017-06-20 |
| First published | 2016-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 23 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4372 |
| Author | amasad |
| Maintainers | loganfsmyth, vignesh.shanmugam, hzoo, boopathi |
| Keywords | babel-preset |

## Links

- npm: https://www.npmjs.com/package/babel-preset-babili
- Repository: https://github.com/babel/babili/tree/master/packages/babel-preset-babili
- Homepage: https://github.com/babel/babili#readme
- Issues: https://github.com/babel/babili/issues
- npm.io page: https://npm.io/package/babel-preset-babili

## Dependencies (23)

- [lodash.isplainobject](https://npm.io/package/lodash.isplainobject.md) ^4.0.6
- [babel-plugin-minify-replace](https://npm.io/package/babel-plugin-minify-replace.md) ^0.1.2
- [babel-plugin-minify-builtins](https://npm.io/package/babel-plugin-minify-builtins.md) ^0.1.3
- [babel-plugin-minify-infinity](https://npm.io/package/babel-plugin-minify-infinity.md) ^0.1.2
- [babel-plugin-minify-simplify](https://npm.io/package/babel-plugin-minify-simplify.md) ^0.1.2
- [babel-plugin-minify-mangle-names](https://npm.io/package/babel-plugin-minify-mangle-names.md) ^0.1.3
- [babel-plugin-minify-constant-folding](https://npm.io/package/babel-plugin-minify-constant-folding.md) ^0.1.3
- [babel-plugin-minify-flip-comparisons](https://npm.io/package/babel-plugin-minify-flip-comparisons.md) ^0.1.2
- [babel-plugin-minify-numeric-literals](https://npm.io/package/babel-plugin-minify-numeric-literals.md) ^0.1.1
- [babel-plugin-minify-type-constructors](https://npm.io/package/babel-plugin-minify-type-constructors.md) ^0.1.2
- [babel-plugin-transform-remove-console](https://npm.io/package/babel-plugin-transform-remove-console.md) ^6.8.4
- [babel-plugin-transform-minify-booleans](https://npm.io/package/babel-plugin-transform-minify-booleans.md) ^6.8.2
- [babel-plugin-transform-remove-debugger](https://npm.io/package/babel-plugin-transform-remove-debugger.md) ^6.8.4
- [babel-plugin-minify-guarded-expressions](https://npm.io/package/babel-plugin-minify-guarded-expressions.md) ^0.1.2
- [babel-plugin-transform-remove-undefined](https://npm.io/package/babel-plugin-transform-remove-undefined.md) ^0.1.2
- [babel-plugin-transform-property-literals](https://npm.io/package/babel-plugin-transform-property-literals.md) ^6.8.4
- [babel-plugin-transform-undefined-to-void](https://npm.io/package/babel-plugin-transform-undefined-to-void.md) ^6.8.2
- [babel-plugin-minify-dead-code-elimination](https://npm.io/package/babel-plugin-minify-dead-code-elimination.md) ^0.1.7
- [babel-plugin-transform-regexp-constructors](https://npm.io/package/babel-plugin-transform-regexp-constructors.md) ^0.1.1
- [babel-plugin-transform-inline-consecutive-adds](https://npm.io/package/babel-plugin-transform-inline-consecutive-adds.md) ^0.1.2
- [babel-plugin-transform-merge-sibling-variables](https://npm.io/package/babel-plugin-transform-merge-sibling-variables.md) ^6.8.5
- [babel-plugin-transform-member-expression-literals](https://npm.io/package/babel-plugin-transform-member-expression-literals.md) ^6.8.4
- [babel-plugin-transform-simplify-comparison-operators](https://npm.io/package/babel-plugin-transform-simplify-comparison-operators.md) ^6.8.4

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2017-06-20
- 0.1.3 — 2017-06-13
- 0.1.2 — 2017-05-23
- 0.1.1 — 2017-05-22
- 0.1.0 — 2017-05-22
- 0.0.12 — 2017-03-03
- 0.0.11 — 2017-02-08
- 0.0.10 — 2017-01-17
- 0.0.9 — 2016-11-22
- 0.0.8 — 2016-10-31
- 0.0.5 — 2016-10-07
- 0.0.4 — 2016-09-30
- 0.0.3 — 2016-09-20
- 0.0.2 — 2016-08-31
- 0.0.1 — 2016-08-26
- … 1 more at https://npm.io/package/babel-preset-babili/versions

## README

# babel-preset-babili

Babel preset for all minify plugins.

+ [Install](#install)
+ [Usage](#usage)
+ [Options](#options)

## Install

```sh
npm install --save-dev babel-preset-babili
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "presets": ["babili"]
}
```

or pass in options -

```json
{
  "presets": [["babili", {
    "mangle": {
      "blacklist": ["MyCustomError"]
    },
    "unsafe": {
      "typeConstructors": false
    },
    "keepFnName": true
  }]]
}
```

### Via CLI

```sh
babel script.js --presets babili
```

### Via Node API

```javascript
require("babel-core").transform("code", {
  presets: ["babili"]
});
```

## Options

Two types of options:

1. 1-1 mapping with plugin
2. The same option passed to multiple plugins

#### 1-1 mapping with plugin

+ `false` - disable plugin
+ `true` - enable plugin
+ `{ ...pluginOpts }` - enable plugin and pass pluginOpts to plugin

OptionName          | Plugin                                                         | DefaultValue
----------          | ------                                                         | ------------
booleans            | [transform-minify-booleans][booleans]                          | true
builtIns            | [minify-builtins][builtIns]                                    | true
consecutiveAdds     | [transform-inline-consecutive-adds][consecutiveAdds]           | true
deadcode            | [minify-dead-code-elimination][deadcode]                       | true
evaluate            | [minify-constant-folding][evaluate]                            | true
flipComparisons     | [minify-flip-comparisons][flipComparisons]                     | true
guards              | [minify-guarded-expressions][guards]                           | true
infinity            | [minify-infinity][infinity]                                    | true
mangle              | [minify-mangle-names][mangle]                                  | true
memberExpressions   | [transform-member-expression-literals][memberExpressions]      | true
mergeVars           | [transform-merge-sibling-variables][mergeVars]                 | true
numericLiterals     | [minify-numeric-literals][numericLiterals]                     | true
propertyLiterals    | [transform-property-literals][propertyLiterals]                | true
regexpConstructors  | [transform-regexp-constructors][regexpConstructors]            | true
removeConsole       | [transform-remove-console][removeConsole]                      | false
removeDebugger      | [transform-remove-debugger][removeDebugger]                    | false
removeUndefined     | [transform-remove-undefined][removeUndefined]                  | true
replace             | [minify-replace][replace]                                      | true
simplify            | [minify-simplify][simplify]                                    | true
simplifyComparisons | [transform-simplify-comparison-operators][simplifyComparisons] | true
typeConstructors    | [minify-type-constructors][typeConstructors]                   | true
undefinedToVoid     | [transform-undefined-to-void][undefinedToVoid]                 | true

#### The same option passed to multiple plugins

+ When multiple plugins require the same option, it's easier to declare it in one place. These options are passed on to two or more plugins.

OptionName          | Plugins
----------          | -------
keepFnName          | Passed to [mangle][mangle] & [deadcode][deadcode]
keepClassName       | Passed to [mangle][mangle] & [deadcode][deadcode]

**Examples**

```json
{
  "presets": [["babili", {
    "evaluate": false,
    "mangle": true
  }]]
}
```

```json
{
  "presets": [["babili", {
    "mangle": {
      "blacklist": ["ParserError", "NetworkError"]
    }
  }]]
}
```

```json
{
  "presets": [["babili", {
    "keepFnName": true
  }]]
}
// is the same as
{
  "presets": [["babili", {
    "mangle": {
      "keepFnName": true
    },
    "deadcode": {
      "keepFnName": true
    }
  }]]
}
```

[booleans]: ../../packages/babel-plugin-transform-minify-booleans
[builtIns]: ../../packages/babel-plugin-minify-builtins
[consecutiveAdds]: ../../packages/babel-plugin-transform-inline-consecutive-adds
[deadcode]: ../../packages/babel-plugin-minify-dead-code-elimination
[evaluate]: ../../packages/babel-plugin-minify-constant-folding
[flipComparisons]: ../../packages/babel-plugin-minify-flip-comparisons
[guards]: ../../packages/babel-plugin-minify-guarded-expressions
[infinity]: ../../packages/babel-plugin-minify-infinity
[mangle]: ../../packages/babel-plugin-minify-mangle-names
[memberExpressions]: ../../packages/babel-plugin-transform-member-expression-literals
[mergeVars]: ../../packages/babel-plugin-transform-merge-sibling-variables
[numericLiterals]: ../../packages/babel-plugin-minify-numeric-literals
[propertyLiterals]: ../../packages/babel-plugin-transform-property-literals
[regexpConstructors]: ../../packages/babel-plugin-transform-regexp-constructors
[removeConsole]: ../../packages/babel-plugin-transform-remove-console
[removeDebugger]: ../../packages/babel-plugin-transform-remove-debugger
[removeUndefined]: ../../packages/babel-plugin-transform-remove-undefined
[replace]: ../../packages/babel-plugin-minify-replace
[simplify]: ../../packages/babel-plugin-minify-simplify
[simplifyComparisons]: ../../packages/babel-plugin-transform-simplify-comparison-operators
[typeConstructors]: ../../packages/babel-plugin-minify-type-constructors
[undefinedToVoid]: ../../packages/babel-plugin-transform-undefined-to-void

---
_Source: https://npm.io/package/babel-preset-babili · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
