# rollup-plugin-config

> Plugin for Rollup to replace variables with values from configuration object (great to use with node-config)

Latest version **1.3.0** (published 2018-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-config
pnpm add rollup-plugin-config
yarn add rollup-plugin-config
bun add rollup-plugin-config
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2018-01-18 |
| First published | 2017-08-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Wain-PC |
| Maintainers | wain-pc |
| Keywords | rollup, rollup-plugin, config, node-config |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-config
- npm.io page: https://npm.io/package/rollup-plugin-config

## Dependencies (2)

- [babylon](https://npm.io/package/babylon.md) ^6.18.0
- [babel-core](https://npm.io/package/babel-core.md) ^6.26.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2018-01-18
- 1.2.0 — 2018-01-17
- 1.1.0 — 2017-11-22
- 1.0.2 — 2017-10-31
- 1.0.1 — 2017-08-08
- 1.0.0 — 2017-08-01

## README

rollup-plugin-config
==========================
[![Build Status](https://travis-ci.org/Wain-PC/rollup-plugin-config.svg?branch=master)](https://travis-ci.org/Wain-PC/rollup-plugin-config)
[![Coverage Status](https://coveralls.io/repos/github/Wain-PC/rollup-plugin-config/badge.svg?branch=master)](https://coveralls.io/github/Wain-PC/rollup-plugin-config?branch=master)

Rollup plugin designed mainly for use with [node-config](https://github.com/lorenwest/node-config) (though you can pass any object you want).

## Installation

Install the package:

- npm `npm install --save-dev rollup-plugin-config`
- yarn `yarn add --dev rollup-plugin-config`

## Usage

Pass any object with a single root node to the plugin (it can be named anything you want). 

```javascript
import { rollup } from 'rollup'
import configPlugin from 'rollup-plugin-config'

	const configObject = {
		one: 1,
		two: 2,
		three: {
			four: 'four'
		}
	};
	
	rollup({
		entry: 'main.js',
		plugins: [
			configPlugin({CONFIG: configObject}) //Now you can use values like CONFIG.one or CONFIG.three.four in your code
		]
	})

```

Use that node name as a global variable in your script.
```javascript
console.log(CONFIG.one + CONFIG.two)
```

It'll get replaced with an actual value from the object you provided.
```javascript
console.log(1 + 2)
```

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