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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.1
    0
  • 2.0.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i babel-plugin-vanilla-shake

Weekly Downloads

0

Version

2.0.1

License

BSD-3-Clause

Unpacked Size

4.63 kB

Total Files

4

Last publish

Collaborators

  • paed01
  • joelabrahamsson
  • captainjinx
  • oscartholander