Skip to content

Commit

Permalink
Tweak simpify README [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
existentialism committed Dec 5, 2016
1 parent a0922fc commit 1a982bd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/babel-plugin-minify-simplify/README.md
@@ -1,10 +1,13 @@
# babel-plugin-minify-simplify

This plugin will transform code in mainly two ways:
> Simplifies code for minification by reducing statements into expressions and making expressions and uniform where possible.
1. Reduce as much statements as possible into expressions
## Example

### Reduce statement into expression

**In**

```js
function foo() {
if (x) a();
Expand All @@ -16,6 +19,7 @@ function foo2() {
```

**Out**

```js
function foo() {
x && a();
Expand All @@ -25,16 +29,18 @@ function foo2() {
}
```

2. Make expressions as uniform as possible for better compressibility
### Make expression as uniform as possible for better compressibility

**In**

```js
undefined
foo['bar']
Number(foo)
```

**Out**

```js
void 0
foo.bar
Expand Down

0 comments on commit 1a982bd

Please sign in to comment.