Gathering detailed insights and metrics for webpack-shell-plugin-next
Gathering detailed insights and metrics for webpack-shell-plugin-next
Gathering detailed insights and metrics for webpack-shell-plugin-next
Gathering detailed insights and metrics for webpack-shell-plugin-next
Run shell commands either before or after webpack 4 and 5 builds
npm install webpack-shell-plugin-next
Typescript
Module System
Node Version
NPM Version
JavaScript (50.2%)
TypeScript (49.19%)
HTML (0.31%)
CSS (0.29%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
96 Stars
81 Commits
12 Forks
4 Watchers
1 Branches
4 Contributors
Updated on May 10, 2025
Latest Version
2.3.2
Package Id
webpack-shell-plugin-next@2.3.2
Unpacked Size
36.37 kB
Size
7.67 kB
File Count
7
NPM Version
10.7.0
Node Version
20.15.0
Published on
Aug 06, 2024
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
fix webpack deprecated method. add typescript and other
This plugin allows you to run any shell commands before or after webpack 5 builds. This will work for both webpack 5.
Goes great with running cron jobs, reporting tools, or tests such as selenium, protractor, phantom, ect.
Webpack | webpack-shell-plugin-next |
---|---|
*-4.x | 1.* |
5.x | 2.* |
This plugin is meant for running simple command line executions. It is not meant to be a task management tool.
npm install --save-dev webpack-shell-plugin-next
In webpack.config.js
:
1const WebpackShellPluginNext = require('webpack-shell-plugin-next'); 2... 3module.exports = { 4 //... 5 plugins: [ 6 new WebpackShellPluginNext({ 7 onBuildStart:{ 8 scripts: ['echo "Webpack Start"'], 9 blocking: true, 10 parallel: false 11 }, 12 onBuildEnd:{ 13 scripts: ['echo "Webpack End"'], 14 blocking: false, 15 parallel: true 16 } 17 }) 18 ] 19 //... 20}
More example in webpack.config.ts
onBeforeBuild
: array of scripts to execute before every build.onBuildError
: array of scripts to execute when there is an error during compilation.onBuildStart
: configuration object for scripts that execute before a compilation.onBuildEnd
: configuration object for scripts that execute after files are emitted at the end of the compilation.onBuildExit
: configuration object for scripts that execute after webpack's process is complete. Note: this event also fires in webpack --watch
when webpack has finished updating the bundle.onWatchRun
: configuration object for scripts that execute when webpack's run watchonDoneWatch
: configuration object for scripts that execute after files are emitted at the end of the compilation with watch.onBeforeNormalRun
: configuration object for scripts that execute on normal run without --watch optiononAfterDone
: configuration object for scripts that execute after done.onFailedBuild
: configuration object for scripts that execute after error.onBeforeCompile
: configuration object for scripts that execute before complite.Default for all: {scripts: [],blocking: false,parallel: false}
blocking (onBeforeBuild, onBuildStart, onBuildEnd, onBuildExit, onBuildExit, onWatchRun)
: block webpack until scripts finish execution.parallel (onBeforeBuild, onBuildStart, onBuildEnd, onBuildExit, onBuildExit, onWatchRun)
: execute scripts in parallel, otherwise execute scripts in the order in which they are specified in the scripts array.Note: below combination is not supported.
1{ 2 blocking: true 3 parallel: true 4}
Other global params
env
: Object with environment variables that will be applied to the executables Default: { }logging
: show output for internal messages. Default: trueswallowError
: ignore script errors (useful in watch mode) Default: falsedev
: 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: false1new WebpackShellPlugin({ 2 onBeforeNormalRun: { 3 // ... 4 }, 5 dev: false, 6 safe: false, 7 logging: true 8 }) 9 ] 10}
This project is written in TypeScript, and type declarations are included. You can take advantage of this if your project's webpack configuration is also using TypeScript (e.g. webpack.config.ts and webpack.config.js).
how to use functions in the queue?
1{ 2 { 3 scripts: [ 4 // sync 5 () => { 6 console.log('run tTimeout 1'); 7 setTimeout(() => console.log('end Timeout 1'), 1000); 8 }, 9 // async 10 () => new Promise((resolve, reject) => { 11 console.log('run async tTimeout'); 12 setTimeout(() => { 13 console.log('end async tTimeout'); 14 resolve('ok'); 15 }, 1000); 16 }), 17 ], 18 blocking: true 19 } 20}
1// use exec 2import * as os from 'os' 3// .. 4{ 5 safe: os.platform() === 'win32', // by default spawn is used everywhere. If you have problems try using safe: true 6 scripts: [ 7 //... 8 ] 9 // ... 10}
If opening a pull request, create an issue describing a fix or feature. Have your pull request point to the issue by writing your commits with the issue number in the message.
Make sure you lint your code by running npm run lint
and you can build the library by running npm run build
.
I appreciate any feed back as well, Thanks for helping!
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
7 existing vulnerabilities detected
Details
Reason
Found 0/10 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
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy 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
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