babel-plugin-transform-minify-booleans

Example

In

  1. true;
  2. false;

Out

  1. !0;
  2. !1;

Installation

  1. npm install babel-plugin-transform-minify-booleans --save-dev

Usage

  1. {
  2. "plugins": ["transform-minify-booleans"]
  3. }

Via CLI

  1. babel --plugins transform-minify-booleans script.js

Via Node API

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