html-webpack-plugin-addons

0.1.1 • Public • Published

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.

Package Sidebar

Install

npm i html-webpack-plugin-addons

Weekly Downloads

7

Version

0.1.1

License

MIT

Last publish

Collaborators

  • cheton