
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
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
The npm package event-hooks-webpack-plugin receives a total of 10,154 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 EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.