Gathering detailed insights and metrics for webpack-hook-plugin
Gathering detailed insights and metrics for webpack-hook-plugin
Gathering detailed insights and metrics for webpack-hook-plugin
Gathering detailed insights and metrics for webpack-hook-plugin
babel-plugin-require-context-hook
Babel plugin to replicate Webpack require.context
event-hooks-webpack-plugin
Execute JavaScript on any available Webpack event hook
webpack-bundle-update-hook-plugin
Add a tapable 'bundle-update' hook to webpack. On bundle updates registered plugins get lists of new, changed and removed modules.
hook-shell-script-webpack-plugin
A Webpack plugin for running shell scripts on any hook provided by Webpack.
run any shell commands before or after webpack builds (with type definition)
npm install webpack-hook-plugin
Typescript
Module System
Node Version
NPM Version
81
Supply Chain
92.5
Quality
75.8
Maintenance
100
Vulnerability
100
License
TypeScript (75.52%)
JavaScript (21.63%)
HTML (2.04%)
CSS (0.82%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
33 Stars
15 Commits
2 Forks
2 Watchers
24 Branches
1 Contributors
Updated on Oct 14, 2024
Latest Version
1.0.7
Package Id
webpack-hook-plugin@1.0.7
Unpacked Size
35.31 kB
Size
6.21 kB
File Count
10
NPM Version
6.9.0
Node Version
10.14.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
23
This plugin allows you to run any shell commands before or after webpack builds. This will work for both webpack and webpack-dev-server.
Goes great with running cron jobs, reporting tools, or tests such as selenium, protractor, phantom, ect.
npm install --save-dev webpack-hook-plugin
In webpack.config.js
:
1import WebpackHookPlugin from 'webpack-hook-plugin'; 2 3module.exports = { 4 //... 5 //... 6 plugins: [ 7 new WebpackHookPlugin({ 8 onBuildStart:['echo "Webpack Start"'], 9 onBuildEnd:['echo "Webpack End"'] 10 }) 11 ], 12 //... 13}
Insert into your webpack.config.js:
1import WebpackHookPlugin from 'webpack-hook-plugin'; 2const path = require('path'); 3 4var plugins = []; 5 6plugins.push(new WebpackHookPlugin({ 7 onBuildStart: ['echo "Starting"'], 8 onBuildEnd: ['python script.py && node script.js'] 9})); 10 11var config = { 12 entry: { 13 app: path.resolve(__dirname, 'src/app.js') 14 }, 15 output: { 16 path: path.resolve(__dirname, 'dist'), // regular webpack 17 filename: 'bundle.js' 18 }, 19 devServer: { 20 contentBase: path.resolve(__dirname, 'src') // dev server 21 }, 22 plugins: plugins, 23 module: { 24 loaders: [ 25 {test: /\.js$/, loaders: 'babel'}, 26 {test: /\.scss$/, loader: 'style!css!scss?'}, 27 {test: /\.html$/, loader: 'html-loader'} 28 ] 29 } 30} 31 32module.exports = config; 33
Once the build finishes, a child process is spawned firing both a python and node script.
onBuildStart
: array of scripts to execute on the initial build. Default: [ ]onBuildEnd
: array of scripts to execute after files are emitted at the end of the compilation. Default: [ ]onBuildExit
: array of scripts to execute after webpack's process is complete. Note: this event also fires in webpack --watch
when webpack has finished updating the bundle. Default: [ ]onCompile
: array of scripts to execute on every compile. Default: [ ]dev
: switch for development environments. This causes scripts to execute once. Useful for running HMR on webpack-dev-server or webpack watch mode. Default: truesafe
: switches script execution process from spawn to exec. If running into problems with spawn, turn this setting on. Default: falseNo vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/14 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
103 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More