A webpack plugin that executes shell commands before and after webpack builds. Version 0.5.0 requires webpack 4+ (peer dependency). It supports arrays of commands for start, end, and exit phases, and provides a 'dev' mode to avoid re-running scripts in watch/watch-dev-server. Unlike alternatives like shelljs-webpack-plugin, it uses spawn by default but offers a 'safe' flag to fall back to exec. The plugin is unmaintained since 2019 and may have issues with webpack 5.
npm install webpack-shell-pluginVerified import paths — ran on the pinned version, not inferred.
Shows how to use WebpackShellPlugin with all three hooks (start, end, exit) in a webpack config.
Remove the verbose option from the plugin configuration.
Add { safe: true } to options.Wrap scripts in try-catch or redirect stderr to a log.
Use a fork like 'webpack-shell-plugin-next' or upgrade to a maintained plugin.
Run 'npm install --save-dev webpack-shell-plugin' and use require('webpack-shell-plugin') in webpack.config.js.