1.0.6 • Published 6 years ago

babel-plugin-strip-test-func v1.0.6

Weekly downloads
23
License
-
Repository
github
Last release
6 years ago

babel-plugin-babel-strip-test-func

Babel plugin stripping test-only function declarations

Example

In

// input code
let foo;

let __test__bar = () => {};

let __test__foo, foobar;

function __test__baz(){}

Out

// output code
let foo;

let foobar;

Installation

$ npm install babel-plugin-strip-test-func

Options

regexp

A regexp used to check identifier.

Example

{
    "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;

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["strip-test-func"]
}

Via CLI

$ babel --plugins strip-test-func script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["strip-test-func"]
});

License

Copyright (c) 2018 Benjamin Van Ryseghem

The code is licensed under the MIT license (see LICENSE).

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago