Registry / devops / webpack-event-plugin

webpack-event-plugin

JSON →
library1.1.1jsnpmunverified

A webpack plugin that executes callbacks after specified compiler hooks (e.g., afterEmit, done). Version 1.1.1 is the latest stable release; no frequent updates. It is similar to on-build-webpack but allows multiple hooks with per-hook callbacks. Useful for running post-build tasks like asset deployment or notification. Limited to webpack 4+ compiler hooks; no tapable integration for async hooks.

npm install webpack-event-plugin
INSTALL
IMPORT
SIG · WEBPACK-EVENT-PLUG
W
webpack-event-plugin
devopsjavascriptv1.1.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WebpackEventPlugin
✓ const WebpackEventPlugin = require('webpack-event-plugin')
✗ import WebpackEventPlugin from 'webpack-event-plugin'
Package does not provide ESM exports; use CommonJS require.
WebpackEventPlugin
✓ new WebpackEventPlugin([{ hook: 'done', callback: () => {} }])
✗ new WebpackEventPlugin({ hook: 'done', callback: () => {} })
Constructor expects an array of hook configs, not a single object.
WebpackEventPlugin
✓ // in webpack config plugins array plugins: [new WebpackEventPlugin(...)]
✗ // applied to compiler after compile compiler.hooks.done.tap('Plugin', new WebpackEventPlugin(...))
Must be used as a plugin in webpack's plugins array, not tapped manually.

Shows WebpackEventPlugin with afterEmit and done hooks in a webpack config.

const WebpackEventPlugin = require('webpack-event-plugin'); module.exports = { // ... other webpack config plugins: [ new WebpackEventPlugin([ { hook: 'afterEmit', callback: (compilation) => { console.log('Build complete! Assets emitted.'); } }, { hook: 'done', callback: (stats) => { console.log(`Build finished in ${stats.endTime - stats.startTime}ms`); } } ]) ] };
Debug
Known issues
gotchaConstructor expects an array of hook config objects, not a single object.
fix
Wrap single config in an array: new WebpackEventPlugin([{...}])
affects: >=1.0.0
gotchaPlugin does not support async hooks or promises; callbacks run synchronously.
fix
Use webpack's built-in compiler hooks directly for async behavior.
affects: >=1.0.0
gotchaHook names must match webpack compiler hooks exactly (e.g., 'afterEmit', 'done').
fix
Refer to webpack compiler hooks documentation for correct names.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: compiler.hooks[this.hook] is not a function
Hook name is not a valid webpack compiler hook or is misspelled.
fix
Use only hook names from webpack compiler hooks (e.g., 'done', 'afterEmit').
Error: Hook is not defined
Hook name does not exist on compiler.hooks.
fix
Check webpack version: compiler hooks changed between versions. Use compatible hook names.
TypeError: WebpackEventPlugin is not a constructor
Trying to import ES module style with import or misspelling the plugin name.
fix
Use require('webpack-event-plugin') and ensure correct spelling.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
2
Resources
webpack-event-plugin — npm install webpack-event-plugin · libregistry