webpack-event-plugin

Webpack plugin to run post event hook methods

Usage no npm install needed!

<script type="module">
  import webpackEventPlugin from 'https://cdn.skypack.dev/webpack-event-plugin';
</script>

README

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/