1.2.2 • Published 3 years ago
babel-plugin-envify v1.2.2
babel-plugin-envify
remove useless process.env judgment according to environment variables for babel
Install
npm i -D babel-plugin-envifyUsage
add file .babelrc to your project root directory, and add plugin:
{
"plugins": [
[
"envify",
{
"omit": ["SOME_NAME"]
}
]
]
}then run babel in command line.
- The
omitoption 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.