1.1.0 • Published 3 years ago

@thoughtsunificator/rollup-plugin-config-env v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

rollup-plugin-config-env

Provide a way to inject environment variables into your application.

Getting started

Installing

  • npm install @thoughtsunificator/rollup-plugin-config-env --save-dev

How does it work?

rollup-plugin-config-env will create a new object from the config file, env file and process.env.

Order of priority:

  1. process.env
  2. env file
  3. config file

Usage

import configEnv from '@thoughtsunificator/rollup-plugin-config-env'

export default {
  plugins: [
    configEnv({ envPath: ".env.json", configPath: "data/config.json" })
  ]
}

data/config.json

{
  "SITE_NAME": "FOO"
}

.env.json

{
  "SITE_NAME": "BAR"
}

Within the context of your application:

import config from ":config"

console.log(config)
/* outputs:
{
  SITE_NAME: "BAR"
}
*/
1.1.0

3 years ago

1.0.9

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.15

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.0

3 years ago