Skip to content

Commit

Permalink
Docs: add plugin descriptions from main readme
Browse files Browse the repository at this point in the history
Also simplify constant-folding’s example
  • Loading branch information
bfred-it committed Jul 9, 2016
1 parent 79c89bd commit 4999016
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
10 changes: 2 additions & 8 deletions packages/babel-plugin-minify-constant-folding/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# babel-plugin-minify-constant-folding

Tries to evaluate expressions and inline the result. For now only deals with numbers and strings.

## Example

**In**

```javascript
"a" + "b"
2 * 3;
1/3;
4 | 3;
a(), b();
var x = 1;
foo(x);
"b" + a + "c" + "d" + g + z + "f" + "h" + "z"
```

Expand All @@ -20,11 +18,7 @@ foo(x);
```javascript
"ab";
6;
1 / 3;
7;
a(), b();
var x = 1;
foo(x);
"b" + a + "cd" + g + z + "fhz";
```

Expand Down
2 changes: 2 additions & 0 deletions packages/babel-plugin-minify-dead-code-elimination/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# babel-plugin-minify-dead-code-elimination

nlines bindings when possible. Tries to evaluate expressions and prunes unreachable as a result.

## Example

**In**
Expand Down
2 changes: 2 additions & 0 deletions packages/babel-plugin-minify-empty-function/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# babel-plugin-minify-empty-function

This is mostly a Facebook-specific transform that removes noop function calls. However, can be generalized to detect and remove noops.

## Example

**In**
Expand Down
2 changes: 2 additions & 0 deletions packages/babel-plugin-minify-mangle-names/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# babel-plugin-minify-mangle-names

Context- and scope- aware variable renaming.

## Example

**In**
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-minify-replace/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# babel-plugin-minify-replace

Configurable "search and replace" plugin
Configurable "search and replace" plugin. Replaces matching nodes in the tree with a given replacement node. For example you can replace `process.NODE_ENV` with `"production"`.

## Example

Expand Down

0 comments on commit 4999016

Please sign in to comment.