html-webpack-plugin-addons

Addons for the html-webpack-plugin to alter the html in your webpack config.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
html-webpack-plugin-addons
100.1.17 years ago7 years agoMinified + gzip package size for html-webpack-plugin-addons in KB

Readme

html-webpack-plugin-addons
NPM
Addons for the html-webpack-plugin to alter the html in your webpack config.

Installation

npm install --save-dev html-webpack-plugin-addons

Usage

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.