0.5.1 • Published 5 years ago

babel-plugin-minify-simplify v0.5.1

Weekly downloads
2,242,767
License
MIT
Repository
github
Last release
5 years ago

babel-plugin-minify-simplify

Simplifies code for minification by reducing statements into expressions and making expressions uniform where possible.

Example

Reduce statement into expression

In

function foo() {
  if (x) a();
}
function foo2() {
  if (x) a();
  else b();
}

Out

function foo() {
  x && a();
}
function foo2() {
  x ? a() : b();
}

Make expression as uniform as possible for better compressibility

In

undefined
foo['bar']
Number(foo)

Out

void 0
foo.bar
+foo

Installation

npm install babel-plugin-minify-simplify

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["minify-simplify"]
}

Via CLI

babel --plugins minify-simplify script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["minify-simplify"]
});
0.6.0-alpha.9

5 years ago

0.5.1

5 years ago

0.5.0

6 years ago

0.5.0-alpha.9

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago