https://github.com/superraytin/html-webpack-simple-inject-plugin
Injects a custom string into the html-webpack-plugin output.
https://github.com/superraytin/html-webpack-simple-inject-plugin
Last synced: about 1 year ago
JSON representation
Injects a custom string into the html-webpack-plugin output.
- Host: GitHub
- URL: https://github.com/superraytin/html-webpack-simple-inject-plugin
- Owner: superRaytin
- License: mit
- Created: 2022-03-18T09:21:43.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-18T10:39:10.000Z (about 4 years ago)
- Last Synced: 2024-04-27T08:50:00.558Z (about 2 years ago)
- Language: JavaScript
- Size: 84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# html-webpack-simple-inject-plugin
Simplely injects a custom string into the html-webpack-plugin output.
[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][npm-url]
[npm-url]: https://npmjs.org/package/html-webpack-simple-inject-plugin
[downloads-image]: http://img.shields.io/npm/dm/html-webpack-simple-inject-plugin.svg
[npm-image]: http://img.shields.io/npm/v/html-webpack-simple-inject-plugin.svg
## Installation
```bash
npm install --save-dev html-webpack-simple-inject-plugin
```
## Example
#### input
```js
import HtmlWebpackPlugin from "html-webpack-plugin"
import HtmlWebpackSimpleInjectPlugin from "html-webpack-simple-inject-plugin"
export default {
plugins: [
new HtmlWebpackPlugin({
templateContent: 'text'
}),
new HtmlWebpackSimpleInjectPlugin({
content: '
inject',
target: 'body',
position: 'start',
}),
],
}
```
#### output
```html
injecttext
```
## Options
|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|**`content`**|`{String}`|""|The string that will be injected into the html-webpack-plugin output.|
|**`target`**|`"head"`\|`"body"`|`'head'`|The target place that you wanted to inject.|
|**`position`**|`"start"`\|`"end"`|`'end'`|If `start`, the content will be injected after the opening tag of `target`. If `end`, the content will be injected before the ending tag of `target`.|