Package Exports
- babel-plugin-transform-inline-environment-variables
- babel-plugin-transform-inline-environment-variables/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-plugin-transform-inline-environment-variables) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
babel-plugin-transform-inline-environment-variables
Inline environment variables
Example
In
// assuming process.env.NODE_ENV is actually "development"
process.env.NODE_ENV;Out
"development";Installation
npm install babel-plugin-transform-inline-environment-variables --save-devUsage
Via .babelrc (Recommended)
.babelrc
// without options
{
"plugins": ["transform-inline-environment-variables"]
}
// with options
{
"plugins": [
["transform-inline-environment-variables", {
"include": [
"NODE_ENV"
]
}]
]
}Via CLI
babel --plugins transform-inline-environment-variables script.jsVia Node API
require("@babel/core").transform("code", {
plugins: ["transform-inline-environment-variables"]
});Options
include- array of environment variables to includeexclude- array of environment variables to exclude