# @thoughtsunificator/rollup-plugin-config-env

> Provide a way to inject environment variables into your bundle

Latest version **1.1.0** (published 2021-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @thoughtsunificator/rollup-plugin-config-env
pnpm add @thoughtsunificator/rollup-plugin-config-env
yarn add @thoughtsunificator/rollup-plugin-config-env
bun add @thoughtsunificator/rollup-plugin-config-env
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-10-28 |
| First published | 2021-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Romain Lebesle |
| Maintainers | thoughtsunificator |

## Links

- npm: https://www.npmjs.com/package/@thoughtsunificator/rollup-plugin-config-env
- Repository: https://github.com/thoughtsunificator/rollup-plugin-config-env
- Homepage: https://github.com/thoughtsunificator/rollup-plugin-config-env#readme
- Issues: https://github.com/thoughtsunificator/rollup-plugin-config-env/issues
- npm.io page: https://npm.io/package/@thoughtsunificator/rollup-plugin-config-env

## Dependencies (1)

- [@thoughtsunificator/config-env](https://npm.io/package/@thoughtsunificator/config-env.md) ^1.0.3

## Recent versions

- 1.1.0 (latest) — 2021-10-28
- 1.0.15 — 2021-10-28
- 1.0.13 — 2021-10-28
- 1.0.12 — 2021-10-27
- 1.0.11 — 2021-10-27
- 1.0.10 — 2021-10-27
- 1.0.9 — 2021-10-27
- 1.0.8 — 2021-10-22
- 1.0.7 — 2021-10-20
- 1.0.6 — 2021-10-20
- 1.0.5 — 2021-10-20
- 1.0.4 — 2021-09-29
- 1.0.3 — 2021-09-29
- 1.0.2 — 2021-09-29
- 1.0.0 — 2021-09-29

## README

# 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

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

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


``data/config.json``
```json
{
  "SITE_NAME": "FOO"
}
```

``.env.json``
```json
{
  "SITE_NAME": "BAR"
}
```

Within the context of your application:

```javascript
import config from ":config"

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

```

---
_Source: https://npm.io/package/@thoughtsunificator/rollup-plugin-config-env · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
