Next Phenomenal Microbrewery
    Wondering what’s next for npm?Check out our public roadmap! »

    babel-plugin-transform-inline-environment-variables

    0.4.3 • Public • Published

    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-dev

    Usage

    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.js

    Via Node API

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

    Options

    • include - array of environment variables to include
    • exclude - array of environment variables to exclude

    Keywords

    Install

    npm i babel-plugin-transform-inline-environment-variables

    DownloadsWeekly Downloads

    203,456

    Version

    0.4.3

    License

    MIT

    Unpacked Size

    2.07 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar