# assets-inject-webpack-plugin

> Assets inject heavily inspired in gulp-inject

Latest version **0.1.1** (published 2017-08-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install assets-inject-webpack-plugin
pnpm add assets-inject-webpack-plugin
yarn add assets-inject-webpack-plugin
bun add assets-inject-webpack-plugin
```

## 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.1 |
| Published | 2017-08-01 |
| First published | 2017-07-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jdavoff |

## Links

- npm: https://www.npmjs.com/package/assets-inject-webpack-plugin
- npm.io page: https://npm.io/package/assets-inject-webpack-plugin

## Dependencies (5)

- [through2](https://npm.io/package/through2.md) ^2.0.3
- [vinyl-fs](https://npm.io/package/vinyl-fs.md) ^2.4.4
- [group-array](https://npm.io/package/group-array.md) ^0.3.3
- [stream-to-array](https://npm.io/package/stream-to-array.md) ^2.3.0
- [escape-string-regexp](https://npm.io/package/escape-string-regexp.md) ^1.0.5

## Recent versions

- 0.1.1 (latest) — 2017-08-01
- 0.1.0 — 2017-07-28

## README

# assets-inject-webpack-plugin

Inject assets into any kind of template, using the core implementation of [gulp-inject](https://github.com/klei/gulp-inject).
In fact the plugin constructor uses the API of gulp-inject.

## Usage
````js 
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const AssetsInjectPlugin = require('assets-inject-webpack-plugin');

//same options object of [gulp-inject](https://github.com/klei/gulp-inject)
const injectOpt = {addPrefix:'my-app'};

const config = {
	entry: {
		app: './src/client/index.js',
		print: './src/client/print.js',
	},
	output: {
		filename: '[name].js',
		path: path.resolve(__dirname, 'dist')
	},
	plugins: [
		new CleanWebpackPlugin(['dist']),
		new AssetsInjectPlugin('./src/server/layout/layout.jade', injectOpt)
	]
};
module.exports = config;

````
## List of compatible file template types:
* Jade/Pug `.jade/.pug`
* HTML `.html`
* JSX `.jsx`
* LESS `.less`
* SASS/SCSS `.sass/.scss`

Contribute
===============

Commit Messages
-------
Rules are adopted from [the AngularJS commit conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/).

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