Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cheton/html-webpack-plugin-addons
Addons for the html-webpack-plugin to alter the html in your webpack config.
https://github.com/cheton/html-webpack-plugin-addons
Last synced: 10 days ago
JSON representation
Addons for the html-webpack-plugin to alter the html in your webpack config.
- Host: GitHub
- URL: https://github.com/cheton/html-webpack-plugin-addons
- Owner: cheton
- License: mit
- Created: 2016-11-08T07:34:34.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-08T07:55:38.000Z (about 8 years ago)
- Last Synced: 2024-10-29T12:33:59.989Z (20 days ago)
- Language: JavaScript
- Size: 5.86 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-plugin-addons
[![NPM](https://nodei.co/npm/html-webpack-plugin-addons.png?downloads=true&stars=true)](https://www.npmjs.com/package/html-webpack-plugin-addons)
Addons for the [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin) to alter the html in your webpack config.
## Installation
```bash
npm install --save-dev html-webpack-plugin-addons
```## Usage
```js
var HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlWebpackPluginAddons = require('html-webpack-plugin-addons');var webpackConfig = {
entry: 'index.js',
output: {
path: 'dist',
filename: 'bundle.js'
},
plugins: [
new HtmlWebpackPlugin(),
// Events (https://github.com/ampedandwired/html-webpack-plugin#events)
new HtmlWebpackPluginAddons({
beforeHTMLGeneration: function(pluginData, next) {
// html-webpack-plugin-before-html-generation
next(null, pluginData);
},
beforeHTMLProcessing: function(pluginData, next) {
// html-webpack-plugin-before-html-processing
next(null, pluginData);
},
alterAssetTags: function(pluginData, next) {
// html-webpack-plugin-alter-asset-tags
next(null, pluginData);
},
afterHTMLProcessing: function(pluginData, next) {
// html-webpack-plugin-after-html-processing
next(null, pluginData);
},
afterEmit: function(pluginData, next) {
// html-webpack-plugin-after-emit
next(null, pluginData);
}
})
]
};module.exports = webpackConfig;
```# License
This project is licensed under [MIT](https://github.com/cheton/html-webpack-plugin-addons/blob/master/LICENSE).