
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
event-hooks-webpack-plugin
Advanced tools
Execute JavaScript on any available Webpack event hook
This Webpack plugin is similar to webpack-shell-plugin
but it allows executing
arbitrary code instead of commands on any compiler hook that is made available by Webpack.
npm install event-hooks-webpack-plugin --save-dev
import EventHooksPlugin from 'event-hooks-webpack-plugin';
export default {
// ...
plugins: [
new EventHooksPlugin({
initialize: () => {
// ...
}
})
]
};
The plugin consumes an object with Webpack compiler event hook names (e.g. run
, compile
,
and done
) as keys and functions as values.
Webpack's compiler uses Tapable which supports different classes of hooks. This plugin supports
synchronous, promise-based, and callback-based hooks through the exported tap
, tapPromise
and tapAsync
methods.
By default, the plugin uses tap
.
import EventHooksPlugin, { tapPromise, tapAsync } from 'event-hooks-webpack-plugin';
export default {
// ...
plugins: [
new EventHooksPlugin({
emit: tapAsync(() => {
// ...
}),
run: tapPromise(() => {
// ...
})
})
]
};
FAQs
Execute JavaScript on any available Webpack event hook
We found that event-hooks-webpack-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.