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

Tweak simpify README #320

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 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