1.2.2 • Published 11 months ago

babel-plugin-envify v1.2.2

Weekly downloads
40
License
ISC
Repository
-
Last release
11 months ago

babel-plugin-envify

remove useless process.env judgment according to environment variables for babel

Install

npm i -D babel-plugin-envify

Usage

add file .babelrc to your project root directory, and add plugin:

{
  "plugins": [
    [
      "envify",
      {
        "omit": ["SOME_NAME"]
      }
    ]
  ]
}

then run babel in command line.

  • The omit option specified fields will not be handled.

Function

If a if statement's test is one binary expression, and left node or right node is member expression as process.env.{ENV_NAME}, and the another node is string literal.

Will be remove or replace by consequent or alternate according to current environment variable's value.

License

MIT

1.2.2

11 months ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago