node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »

babel-plugin-transform-inline-environment-variables

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

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-inline-environment-variables"]
}

Via CLI

babel --plugins transform-inline-environment-variables script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-inline-environment-variables"]
});