1.0.1 • Published 4 years ago

babel-env-var v1.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

babel-env-var

Inline environment variables (or .env files) at build time

Quick Start

Add something like this to your babel config:

module.exports = function(api) {
  api.cache(true);
  return {
    plugins: [
      [
        require("babel-env-var"),
        {
          dotEnvDir: path.resolve(__dirname),
          whitelist: ["MY_ENV_VAR"],
          defaults: {
            MY_ENV_VAR: "some important environment variable"
          }
        }
      ]
    ]
  }
};

Then in your code:

import { MY_ENV_VAR } from "babel-env-var/imports";
console.log(MY_ENV_VAR);
1.0.1

4 years ago

1.0.0

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago