Switch branches/tags
v0.0.1 gulp-babili@0.1.4 gulp-babili@0.1.3 gulp-babili@0.1.2 gulp-babili@0.1.1 gulp-babili@0.1.0 gulp-babili@0.0.2 gulp-babel-minify@0.5.0 gulp-babel-minify@0.4.3 gulp-babel-minify@0.4.2 gulp-babel-minify@0.4.1 gulp-babel-minify@0.4.0 gulp-babel-minify@0.3.0 gulp-babel-minify@0.2.0 babili@0.1.4 babili@0.1.3 babili@0.1.2 babili@0.1.1 babili@0.1.0 babili@0.0.12 babili@0.0.11 babili@0.0.10 babili@0.0.9 babili@0.0.8 babili@0.0.7 babili@0.0.6 babili@0.0.5 babili@0.0.4 babili@v0.0.3 babili@v0.0.2 babel-preset-minify@0.5.0 babel-preset-minify@0.4.3 babel-preset-minify@0.4.2 babel-preset-minify@0.4.1 babel-preset-minify@0.4.0 babel-preset-minify@0.3.0 babel-preset-minify@0.2.0 babel-preset-babili@0.1.4 babel-preset-babili@0.1.3 babel-preset-babili@0.1.2 babel-preset-babili@0.1.1 babel-preset-babili@0.1.0 babel-preset-babili@0.0.12 babel-preset-babili@0.0.11 babel-preset-babili@0.0.10 babel-preset-babili@0.0.8 babel-preset-babili@0.0.5 babel-preset-babili@0.0.4 babel-preset-babili@0.0.3 babel-preset-babili@0.0.2 babel-plugin-transform-undefined-to-void@6.9.4 babel-plugin-transform-undefined-to-void@6.9.3 babel-plugin-transform-undefined-to-void@6.9.2 babel-plugin-transform-undefined-to-void@6.9.1 babel-plugin-transform-undefined-to-void@6.9.0 babel-plugin-transform-undefined-to-void@6.8.3 babel-plugin-transform-undefined-to-void@6.8.2 babel-plugin-transform-undefined-to-void@6.8.1 babel-plugin-transform-simplify-comparison-operators@6.9.4 babel-plugin-transform-simplify-comparison-operators@6.9.3 babel-plugin-transform-simplify-comparison-operators@6.9.2 babel-plugin-transform-simplify-comparison-operators@6.9.1 babel-plugin-transform-simplify-comparison-operators@6.9.0 babel-plugin-transform-simplify-comparison-operators@6.8.5 babel-plugin-transform-simplify-comparison-operators@6.8.4 babel-plugin-transform-simplify-comparison-operators@6.8.3 babel-plugin-transform-simplify-comparison-operators@6.8.2 babel-plugin-transform-simplify-comparison-operators@6.8.1 babel-plugin-transform-remove-undefined@0.5.0 babel-plugin-transform-remove-undefined@0.4.3 babel-plugin-transform-remove-undefined@0.4.2 babel-plugin-transform-remove-undefined@0.4.1 babel-plugin-transform-remove-undefined@0.4.0 babel-plugin-transform-remove-undefined@0.3.0 babel-plugin-transform-remove-undefined@0.2.0 babel-plugin-transform-remove-undefined@0.1.2 babel-plugin-transform-remove-undefined@0.1.1 babel-plugin-transform-remove-undefined@0.1.0 babel-plugin-transform-remove-undefined@0.0.5 babel-plugin-transform-remove-undefined@0.0.4 babel-plugin-transform-remove-debugger@6.9.4 babel-plugin-transform-remove-debugger@6.9.3 babel-plugin-transform-remove-debugger@6.9.2 babel-plugin-transform-remove-debugger@6.9.1 babel-plugin-transform-remove-debugger@6.9.0 babel-plugin-transform-remove-debugger@6.8.5 babel-plugin-transform-remove-debugger@6.8.4 babel-plugin-transform-remove-debugger@6.8.3 babel-plugin-transform-remove-debugger@6.8.2 babel-plugin-transform-remove-debugger@6.8.1 babel-plugin-transform-remove-console@6.9.4 babel-plugin-transform-remove-console@6.9.3 babel-plugin-transform-remove-console@6.9.2 babel-plugin-transform-remove-console@6.9.1 babel-plugin-transform-remove-console@6.9.0 babel-plugin-transform-remove-console@6.8.5 babel-plugin-transform-remove-console@6.8.4 babel-plugin-transform-remove-console@6.8.3 babel-plugin-transform-remove-console@6.8.2 babel-plugin-transform-remove-console@6.8.1
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
__tests__
src
.npmignore
README.md
package.json

README.md

babel-plugin-minify-guarded-expressions

Example

In

!x && foo();
alert(0 && new Foo());

Out

x || foo();
alert(0);

Installation

npm install babel-plugin-minify-guarded-expressions --save-dev

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["minify-guarded-expressions"]
}

Via CLI

babel --plugins minify-guarded-expressions script.js

Via Node API

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