Babel plugin stripping test-only function declarations
In
// input code
let foo;
let __test__bar = () => {};
let __test__foo, foobar;
function __test__baz(){}
Out
// output code
let foo;
let foobar;
$ npm install babel-plugin-strip-test-func
A regexp used to check identifier.
{
"plugins": [
[
"strip-test-func",
{
"regexp": "^__foo__"
}
]
]
}
In
// input code
let foo;
let __foo__bar = () => {};
let __foo__foo, foobar;
function __foo__baz(){}
Out
// output code
let foo;
let foobar;
.babelrc
{
"plugins": ["strip-test-func"]
}
$ babel --plugins strip-test-func script.js
require("babel-core").transform("code", {
plugins: ["strip-test-func"]
});
Copyright (c) 2018 Benjamin Van Ryseghem
The code is licensed under the MIT license (see LICENSE).