
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
webpack-cmd-shell-plugin
Advanced tools
Run flexible and configurable shell commands through each step of the webpack build process
Run flexible and configurable shell commands through each step of the webpack build process.
npm install --save-dev webpack-cmd-shell-plugin
In webpack.config.js:
const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = {
. . .
. . .
plugins: [
new WebpackCmdShellPlugin({
enforceOrder: true,
beforeStart: 'karma start',
whenDone: [
'npm version patch -m "Incrementing app version to %s"',
'git push origin HEAD',
'git push --tags'
]
})
]
};
Insert into your webpack.config.js:
const path = require('path');
const WebpackCmdShellPlugin = require('webpack-cmd-shell-plugin');
const WebpackCmdShellPluginConfig = new WebpackCmdShellPlugin({
enforceOrder: true,
beforeStart: 'echo Webpack is starting up',
beforeCompile: 'echo Webpack is starting a compile stage',
afterCompile: 'echo Webpack has finished compiling stage',
onEmit: 'echo Webpack is emitting files',
afterEmit: 'echo Webpack has finished emitting files',
whenDone: [
'echo Attempting to run npm version patch next',
'npm version patch --no-git-tag-version',
'echo Webpack has finished building'
]
});
module.exports = {
entry: {
app: path.resolve(__dirname, 'src/app.js')
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['es2015']
}
}
}]
}
plugins: [WebpackCmdShellPluginConfig]
};
beforeStart: script or array of scripts that are executed before webpack starts building.beforeCompile: script or array of scripts that are executed before webpack starts compiling a bundle of assetsafterCompile: script or array of scripts that are executed after webpack finishes compiling a bundle of assetsonEmit: script or array of scripts that are executed when webpack starts emitting filesafterEmit: script or array of scripts that are executed when webpack finishes emitting fileswhenDone: script or array of scripts that are executed when webpack finishes buildingenforceOrder: ensures that an array of scripts for a certain build process are executed in order Default: falseIf 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
Example: git commit -m "Fixing typo within documentation #18"
Christopher Thaw
FAQs
Run flexible and configurable shell commands through each step of the webpack build process
We found that webpack-cmd-shell-plugin demonstrated a not healthy version release cadence and project activity because the last version was released 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.