Socket
Socket
Sign inDemoInstall

babel-plugin-minify-simplify

Package Overview
Dependencies
4
Maintainers
5
Versions
87
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-minify-simplify

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


Version published
Weekly downloads
433K
increased by3.67%
Maintainers
5
Install size
84.6 kB
Created
Weekly downloads
 

Readme

Source

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 --save-dev

Usage

.babelrc

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

Via CLI

babel --plugins minify-simplify script.js

Via Node API

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

Keywords

FAQs

Last updated on 15 Aug 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc