# webpack-config-env

> Inject environment variables into your [webpack] build.

Latest version **0.1.0** (published 2017-02-06) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install webpack-config-env
pnpm add webpack-config-env
yarn add webpack-config-env
bun add webpack-config-env
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-02-06 |
| First published | 2017-02-06 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Neal Granger |
| Maintainers | nealgranger |

## Links

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

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [webpack-partial](https://npm.io/package/webpack-partial.md) ^2.0.2

## Recent versions

- 0.1.0 (latest) — 2017-02-06

## README

#webpack-config-env

Inject environment variables into your [webpack] build.

[![build status](http://img.shields.io/travis/webpack-config/webpack-config-env/master.svg?style=flat)](https://travis-ci.org/webpack-config/webpack-config-env)
[![coverage](http://img.shields.io/coveralls/webpack-config/webpack-config-env/master.svg?style=flat)](https://coveralls.io/github/webpack-config/webpack-config-env?branch=master)
[![license](http://img.shields.io/npm/l/webpack-config-env.svg?style=flat)](https://www.npmjs.com/package/webpack-config-env)
[![version](http://img.shields.io/npm/v/webpack-config-env.svg?style=flat)](https://www.npmjs.com/package/webpack-config-env)
[![downloads](http://img.shields.io/npm/dm/webpack-config-env.svg?style=flat)](https://www.npmjs.com/package/webpack-config-env)

## Usage

Install:
```sh
npm install --save webpack-config-env
```

Add to your `webpack.config.babel.js`:

```js
import env from `webpack-config-env`;

env({
  NODE_ENV: {required: false},
  DEPLOY_ENV: {required: process.env.NODE_ENV === 'production'},
  API_URL: {
    required: true,
    value: process.env.NODE_ENV !== 'production'
     ? 'https://my-app-api.herokuapp.com/api'
     : undefined,
  },
})({
  /* existing webpack configuration */
})
```

[webpack]: https://webpack.github.io

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