
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
event-hooks-webpack-plugin
Advanced tools
This webpack plugin is similar to webpack-shell-plugin
but this allows you to execute arbitrary JavaScript instead of commands on any event hook that is exposed by the Webpack compiler.
Compatibility
Version ^2.0.0
of this plugin is compatible with webpack ^4.0.0
. If you're using an older version of webpack, make sure to install the ^1.0.0
(npm install event-hooks-webpack-plugin@^1.0.0
) release of this plugin.
npm install event-hooks-webpack-plugin --save-dev
const EventHooksPlugin = require('event-hooks-webpack-plugin');
module.exports = {
// ...
plugins: [
new EventHooksPlugin({
eventName: () => {
// ...
}
})
]
};
const EventHooksPlugin = require('event-hooks-webpack-plugin');
const { CallbackTask } = require('event-hooks-webpack-plugin/lib/tasks');
module.exports = {
// ...
plugins: [
new EventHooksPlugin({
eventName: new CallbackTask((compiler, callback) => {
// ...
callback();
})
})
]
};
const EventHooksPlugin = require('event-hooks-webpack-plugin');
const { PromiseTask } = require('event-hooks-webpack-plugin/lib/tasks');
module.exports = {
// ...
plugins: [
new EventHooksPlugin({
eventName: new PromiseTask(async () => {
// ...
})
})
]
};
The plugin consumes an object with webpack compiler event hook names (e.g. run
, compile
, or done
) as keys and functions or task classes as values.
FAQs
Execute JavaScript on any available Webpack event hook
The npm package event-hooks-webpack-plugin receives a total of 9,264 weekly downloads. As such, event-hooks-webpack-plugin popularity was classified as popular.
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
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.