env.macro
v1.0.3
Published
Inline environment variables at compile-time
Downloads
259
Maintainers
Readme
env.macro
Babel macro that inlines environment variables if they exist at compile-time, otherwise deferring to insertion at runtime.
Installation
npm i -D env.macro
Usage
import env from 'env.macro'
const variable = env('ENV VAR')
if 'ENV VAR' exists at compile time transforms to:
const variable = 'Value'
otherwise:
const variable = process.env['ENV VAR']