babel-plugin-vanilla-shake
v2.0.1
Published
Vanilla conditional compile plugin
Downloads
5
Readme
vanilla-shake
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);