/webpack-event-plugin

Webpack plugin for running methods after webpack event hooks

Primary LanguageJavaScriptMIT LicenseMIT

webpack-event-plugin

Inspired by on-build-webpack but allows for adding a callback after user specified webpack event hooks.

NPM
npm

Installation

npm install --save-dev webpack-event-plugin

Usage

const WebpackEventPlugin = require('webpack-event-plugin');

// ...  
plugins: [
  new WebpackEventPlugin([
    {
      hook: 'afterEmit',
      callback: (compilation) => {
        console.log('Files emitted!');
      }
    }
  ])
]
// ...

Available event hooks

https://webpack.js.org/api/compiler-hooks/