# inject-config-loader

> inject config into webpack bundle

Latest version **0.1.0** (published 2019-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install inject-config-loader
pnpm add inject-config-loader
yarn add inject-config-loader
bun add inject-config-loader
```

## 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 | 2019-05-15 |
| First published | 2019-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | tinkerscript |
| Maintainers | tinker |

## Links

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

## Dependencies (1)

- [loader-utils](https://npm.io/package/loader-utils.md) 1.2.3

## Recent versions

- 0.1.0 (latest) — 2019-05-15
- 0.0.5 — 2019-05-14
- 0.0.4 — 2019-05-14
- 0.0.3 — 2019-05-13
- 0.0.2 — 2019-05-13
- 0.0.1 — 2019-05-13

## README

# inject-config-loader

[![Build Status](https://travis-ci.org/tinkerscript/inject-config-loader.svg?branch=master)](https://travis-ci.org/tinkerscript/inject-config-loader)

inject config into webpack bundle

## Install
```bash
yarn add -D inject-config-loader
```

## Usage
```javascript
// webpack.config.js

module.exports = {
  // ...
  resolve: {
    alias: {
      config: path.join(__dirname, 'source/dummy.config')
    }
  },
  module: {
    rules: [
      {
        test: /\.config$/,
        use: [
          {
            loader: 'inject-config-loader',
            options: {
              field: 'front'
            }
          }
        ]
      }
    ]
  },
  // ...
}
```
## Options
### field (string)
Name of a config property that will be injected. By default whole config is injected.
### cache (bool)
Default value: true (recommended for production).
If false, all changes in config files will trigger an incremental build.

## Example
See sample webpack.config.js in [demo folder](https://github.com/tinkerscript/inject-config-loader/tree/master/demo).

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