ts-transform-node-env-inline
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

ts-transform-node-env-inline

  • 🔦 Inline environment variables, e.g. process.env.NODE_ENV

Inline environment variables.

Example

In

process.env.NODE_ENV === "development";
process.env.NODE_ENV === "production";
// tsconfig.json
{
  "compilerOptions": {
    "target": "es2015",
    "plugins": [
      {
        "transform": "../lib",
        "type": "config",
        "env": { "NODE_ENV": "hello-world" }
      }
    ]
  }
}

Out

process.env.NODE_ENV === "development";
process.env.NODE_ENV === "production";

Installation

npm install ts-transform-node-env-inline ttypescript --save-dev

Usage

// tsconfig.json
{
  "compilerOptions": {
    "target": "es2015",
    "plugins": [
      {
        "transform": "../lib",
        "type": "config",
        "env": { "NODE_ENV": "production" }
      }
    ]
  }
}

See TTypeScript for docs about integration with other toolchains.


See ./example for a basic setup based on TTypeScript

Prior art

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i ts-transform-node-env-inline

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

9.02 kB

Total Files

20

Last publish

Collaborators

  • marionebl