babel-plugin-vanilla-shake

2.0.0 • Public • Published

vanilla-shake

Build Statusdependencies StatuspeerDependencies Status

vanilla conditional compile plugin for babel.

consider this:

const foo = 1;
const bar = 2;
if (SHOULD_KEEP) {
  console.log(foo);
} else if (SHOULD_KEEP_2) {
  console.log(bar);
} else {
  console.log("hej")
}

configure the plugin like this:

{
  plugins: [["vanilla-shake", {
    defined: {
      SHOULD_KEEP: false,
      SHOULD_KEEP_2: true
    }
  }]]
}

after code is transpiled with the configured plugin:

const foo = 1;
const bar = 2;
 
console.log(bar);

install

npm i babel-plugin-vanilla-shake

Downloadsweekly downloads

69

version

2.0.0

license

BSD-3-Clause

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability