babel-plugin-vanilla-shake

2.0.1 • Public • Published

vanilla-shake

Build 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);

/babel-plugin-vanilla-shake/

    Package Sidebar

    Install

    npm i babel-plugin-vanilla-shake

    Weekly Downloads

    2

    Version

    2.0.1

    License

    BSD-3-Clause

    Unpacked Size

    4.63 kB

    Total Files

    4

    Last publish

    Collaborators

    • paed01
    • joelabrahamsson
    • captainjinx
    • oscartholander