# entry-generator-webpack-plugin

> A Webpack plugin to dynamically generate an entry file on compiler initialisation

Latest version **1.0.0** (published 2016-10-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install entry-generator-webpack-plugin
pnpm add entry-generator-webpack-plugin
yarn add entry-generator-webpack-plugin
bun add entry-generator-webpack-plugin
```

## 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.0.0 |
| Published | 2016-10-31 |
| First published | 2015-12-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | bholloway |
| Maintainers | bholloway |
| Keywords | webpack, plugin, gulp-inject, html, inject |

## Links

- npm: https://www.npmjs.com/package/entry-generator-webpack-plugin
- Repository: https://github.com/bholloway/entry-generator-webpack-plugin
- Issues: https://github.com/bholloway/entry-generator-webpack-plugin/issues
- npm.io page: https://npm.io/package/entry-generator-webpack-plugin

## Dependencies (6)

- [q](https://npm.io/package/q.md) ^1.4.1
- [webpack](https://npm.io/package/webpack.md) ^1.12.9
- [fs-promise](https://npm.io/package/fs-promise.md) ^0.3.1
- [glob-promise](https://npm.io/package/glob-promise.md) ^1.0.4
- [lodash.assign](https://npm.io/package/lodash.assign.md) ^3.2.0
- [require-path-relative](https://npm.io/package/require-path-relative.md) ^1.0.1

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-10-31
- 0.2.2 — 2016-10-31
- 0.2.1 — 2016-03-29
- 0.2.0 — 2016-02-02
- 0.1.0 — 2016-01-29
- 0.0.3 — 2015-12-18
- 0.0.2 — 2015-12-17
- 0.0.1 — 2015-12-17

## README

# Entry Generator Webpack Plugin

[![NPM](https://nodei.co/npm/entry-generator-webpack-plugin.png)](http://github.com/bholloway/entry-generator-webpack-plugin)

A Webpack plugin to dynamically generate an entry file on compiler initialisation

## Rationale

Sometimes you will want to generate an entry file dynamically. This file may consist of your bower dependencies or it may be a test suite that consists of all your unit test specification files.

This plugin will generate such a file if it is not already present. You may depende your compiler upon the output of this plugin.

## Usage

The plugin is of the following form.

```javascript
new EntryGeneratorWebpackPlugin(outputFile, sources)
```

where:
* `outputFile` is the javascript file that will be generated
* `sources` is a `function|Array.<function>` of methods that return a list of files or promise to such

### Webpack configuration

The following configuration generates a `vendor.js` files that consists of your bower `dependencies`.

```javascript
var EntryGeneratorWebpackPlugin = require('entry-generator-webpack-plugin')

module.exports = {
	entry; {
		vendor: 'vendor.js'
		...
	},
	...
	plugins: [
		new EntryGeneratorWebpackPlugin('vendor.js', [
			EntryGeneratorWebpackPlugin.bowerDependenciesSource(),
			...
		]),
		...
	]
}
```

The sources are one or more `function([outputPath:string]):Array.<string>|Promise`. It returns a list of files relative to the given output path or a list of module names or a promise that resolves to such.

### Sources

There are a number of source factories exported on `EntryGeneratorWebpackPlugin`, these include:

* **`EntryGeneratorWebpackPlugin.bowerDependenciesSource([options])`**

	A source factory that will list bower modules from the **`dependencies`** field of the `bower.json` file in the Webpack `context` directory. The `options` may include any of the standard Webpack file filters (although applied to the module names), meaning `test`, `include`, `exclude`.


* **`EntryGeneratorWebpackPlugin.bowerDevDependenciesSource([options])`**

	As above, for the **`devDependencies`** field.

* **`EntryGeneratorWebpackPlugin.globSource(pattern, [options])`**

	A source factory that can glob files rooted in the Webpack `context` directory. It supports `options` per [glob properties](https://www.npmjs.com/package/glob#properties). The `options` may also include any of the standard Webpack file filters (although applied to the module names), meaning `test`, `include`, `exclude`. Note however that it is more efficient to use the glob `ignore` property than the Webpack `exclude` regular expression.

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