Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update babel.github.io babili plugin docs #1029

Merged
merged 1 commit into from
Dec 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/plugins/minify-constant-folding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Minify constant folding
description: Tries to evaluate expressions and inline the result. For now only deals with numbers and strings
permalink: /docs/plugins/minify-constant-folding/
package: babel-plugin-minify-constant-folding
---

{% include package_readme.html from="babili" %}
9 changes: 9 additions & 0 deletions docs/plugins/minify-dead-code-elimination.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Minify dead code elimination
description: Inlines bindings when possible. Tries to evaluate expressions and prunes unreachable as a result
permalink: /docs/plugins/minify-dead-code-elimination/
package: babel-plugin-minify-dead-code-elimination
---

{% include package_readme.html from="babili" %}
9 changes: 9 additions & 0 deletions docs/plugins/minify-empty-function.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Minify empty function
description: This is mostly a Facebook-specific transform that removes noop function calls. However, can be generalized to detect and remove noops
permalink: /docs/plugins/minify-empty-function/
package: babel-plugin-minify-empty-function
---

{% include package_readme.html from="babili" %}
9 changes: 9 additions & 0 deletions docs/plugins/minify-flip-comparisons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Minify flip comparisons
description: While this plugin doesn’t shorten the output in any way, it does optimize it for repetition-based compression algorithms such as gzip
permalink: /docs/plugins/minify-flip-comparisons/
package: babel-plugin-minify-flip-comparisons
---

{% include package_readme.html from="babili" %}
9 changes: 9 additions & 0 deletions docs/plugins/minify-guarded-expressions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Minify guarded expressions
description:
permalink: /docs/plugins/minify-guarded-expressions/
package: babel-plugin-minify-guarded-expressions
---

{% include package_readme.html from="babili" %}
9 changes: 9 additions & 0 deletions docs/plugins/minify-infinity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Minify infinity
description:
permalink: /docs/plugins/minify-infinity/
package: babel-plugin-minify-infinity
---

{% include package_readme.html from="babili" %}
9 changes: 9 additions & 0 deletions docs/plugins/minify-mangle-names.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Minify mangle names
description: Context - and scope - aware variable renaming
permalink: /docs/plugins/minify-mangle-names/
package: babel-plugin-minify-mangle-names
---

{% include package_readme.html from="babili" %}
9 changes: 9 additions & 0 deletions docs/plugins/minify-numeric-literals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Minify numeric literals
description: Shortening of numeric literals via scientific notation
permalink: /docs/plugins/minify-numeric-literals/
package: babel-plugin-minify-numeric-literals
---

{% include package_readme.html from="babili" %}
9 changes: 9 additions & 0 deletions docs/plugins/minify-replace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Minify replace
description: Configurable "search and replace" plugin. Replaces matching nodes in the tree with a given replacement node
permalink: /docs/plugins/minify-replace/
package: babel-plugin-minify-replace
---

{% include package_readme.html from="babili" %}
9 changes: 9 additions & 0 deletions docs/plugins/minify-simplify.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Minify simplify
description: This plugin will transform code in mainly two ways - 1) Reduce as much statements as possible into expressions, and 2) Make expressions as uniform as possible for better compressibility
permalink: /docs/plugins/minify-simplify/
package: babel-plugin-minify-simplify
---

{% include package_readme.html from="babili" %}
Copy link
Member

@xtuc xtuc Dec 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add an extra line between the text and the code block, since markdownify behaves differently than GH flavored markdown.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make the changes now. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @existentialism Is this where the actual documentation is, not on this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @xtuc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xtuc pushed a quick fix: babel/minify#320

9 changes: 9 additions & 0 deletions docs/plugins/minify-type-constructors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Minify type constructors
description: Not recommended if full support for IE8 and lower is required
permalink: /docs/plugins/minify-type-constructors/
package: babel-plugin-minify-type-constructors
---

{% include package_readme.html from="babili" %}
9 changes: 9 additions & 0 deletions docs/plugins/transform-inline-consecutive-adds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Inline consecutive adds transform
description: This plugin inlines consecutive property assignments, array pushes, etc
permalink: /docs/plugins/transform-inline-consecutive-adds/
package: babel-plugin-transform-inline-consecutive-adds
---

{% include package_readme.html from="babili" %}
50 changes: 2 additions & 48 deletions docs/plugins/transform-inline-environment-variables.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,9 @@
---
layout: docs
title: Inline environment variables transform
description:
description: Inline environment variables
permalink: /docs/plugins/transform-inline-environment-variables/
package: babel-plugin-transform-inline-environment-variables
---

This plugin allows Babel to transform inlines environment variables.

## Example

For example compiling the following file:

**script.js**

```javascript
if (process.env.NODE_ENV === "development") {
development();
} else {
production();
}
```

with the command:

```sh
$ NODE_ENV=development babel --plugins transform-inline-environment-variables script.js
```

outputs:

```javascript
if ("development" === "development") {
development();
} else {
production();
}
```

## Installation

```sh
$ npm install --save-dev babel-plugin-transform-inline-environment-variables
```

## Usage

Add the following line to your `.babelrc` file:

```json
{
"plugins": ["transform-inline-environment-variables"]
}
```
{% include package_readme.html from="babili" %}
34 changes: 2 additions & 32 deletions docs/plugins/transform-member-expression-literals.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@
---
layout: docs
title: Member expression literals transform
description:
description: Turn valid member expression property literals into plain identifiers
permalink: /docs/plugins/transform-member-expression-literals/
package: babel-plugin-transform-member-expression-literals
---

This plugin allows Babel to transform member expression valid identifier literal properties into identifiers.

## Example

**In**

```javascript
foo["bar"];
```

**Out**

```javascript
foo.bar;
```

## Installation

```sh
$ npm install --save-dev babel-plugin-transform-member-expression-literals
```

## Usage

Add the following line to your `.babelrc` file:

```json
{
"plugins": ["transform-member-expression-literals"]
}
```
{% include package_readme.html from="babili" %}
36 changes: 2 additions & 34 deletions docs/plugins/transform-merge-sibling-variables.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,9 @@
---
layout: docs
title: Merge sibling variables transform
description:
description: Merge sibling variables into one
permalink: /docs/plugins/transform-merge-sibling-variables/
package: babel-plugin-transform-merge-sibling-variables
---

This plugin allows Babel to merge sibling variable declarations.

## Example

**In**

```javascript
var foo = "bar";
var bar = "foo";
```

**Out**

```javascript
var foo = "bar",
bar = "foo";
```

## Installation

```sh
$ npm install --save-dev babel-plugin-transform-merge-sibling-variables
```

## Usage

Add the following line to your `.babelrc` file:

```json
{
"plugins": ["transform-merge-sibling-variables"]
}
```
{% include package_readme.html from="babili" %}
2 changes: 1 addition & 1 deletion docs/plugins/transform-minify-booleans.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: docs
title: Minify booleans transform
description:
description: This plugin allows Babel to transform boolean literals into !0 for true and !1 for false
permalink: /docs/plugins/transform-minify-booleans/
package: babel-plugin-transform-minify-booleans
---
Expand Down
41 changes: 2 additions & 39 deletions docs/plugins/transform-node-env-inline.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,9 @@
---
layout: docs
title: NODE_ENV inline transform
description:
description: Inline the NODE_ENV environment variable and if it's a part of a binary expression
permalink: /docs/plugins/transform-node-env-inline/
package: babel-plugin-transform-node-env-inline
---

Inline the `NODE_ENV` environment variable and if it's a part of a binary expression
(eg. `process.env.NODE_ENV === "development"`) then statically evaluate and replace it.

## Example

**In**

```javascript
process.env.NODE_ENV === "development";
process.env.NODE_ENV === "production";
```

**Out**

```sh
$ NODE_ENV=development babel in.js --plugins transform-node-env-inline
```

```javascript
true;
false;
```

## Installation

```sh
$ npm install --save-dev babel-plugin-transform-node-env-inline
```

## Usage

Add the following line to your `.babelrc` file:

```json
{
"plugins": ["transform-node-env-inline"]
}
```
{% include package_readme.html from="babili" %}
38 changes: 2 additions & 36 deletions docs/plugins/transform-property-literals.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,9 @@
---
layout: docs
title: Property literals transform
description:
description: This plugin allows Babel to transform valid identifier property key literals into identifiers
permalink: /docs/plugins/transform-property-literals/
package: babel-plugin-transform-property-literals
---

This plugin allows Babel to transform valid identifier property key literals into identifiers.

## Example

**In**

```javascript
var foo = {
"bar": function () {}
};
```

**Out**

```javascript
var foo = {
bar: function () {}
};
```

## Installation

```sh
$ npm install --save-dev babel-plugin-transform-property-literals
```

## Usage

Add the following line to your `.babelrc` file:

```json
{
"plugins": ["transform-property-literals"]
}
```
{% include package_readme.html from="babili" %}
9 changes: 9 additions & 0 deletions docs/plugins/transform-regexp-constructors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: docs
title: Regexp constructors transform
description: This changes RegExp constructors into literals if the RegExp arguments are strings
permalink: /docs/plugins/transform-regexp-constructors/
package: babel-plugin-transform-regexp-constructors
---

{% include package_readme.html from="babili" %}
Loading