{"id":20843,"library":"webpack-synchronizable-shell-plugin","title":"Webpack Synchronizable Shell Plugin","description":"A webpack plugin that runs shell commands before, after, or on exit of the build process, forked from webpack-shell-plugin. Version 0.0.7 (2018) is the latest stable release; no updates since. Unlike alternatives, it provides fine-grained control over script execution order with blocking and parallel options per lifecycle hook (onBuildStart, onBuildEnd, onBuildExit). Suitable for tasks like linting, testing, or deployment scripts. Note: development seems abandoned; last commit 2018.","status":"active","version":"0.0.7","language":"javascript","source_language":"en","source_url":"https://github.com/Feiyang1/webpack-shell-plugin","tags":["javascript","webpack","shell","plugin","serve","hmr","browser","script"],"install":[{"cmd":"npm install webpack-synchronizable-shell-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-synchronizable-shell-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-synchronizable-shell-plugin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package does not provide ES modules; must use require() in webpack.config.js.","wrong":"import WebpackSynchronizableShellPlugin from 'webpack-synchronizable-shell-plugin';","symbol":"WebpackSynchronizableShellPlugin","correct":"const WebpackSynchronizableShellPlugin = require('webpack-synchronizable-shell-plugin');"},{"note":"Plain object with scripts array is not accepted; must use lifecycle hooks like onBuildStart.","wrong":"new WebpackSynchronizableShellPlugin({ scripts: ['echo start'] })","symbol":"new WebpackSynchronizableShellPlugin({...})","correct":"new WebpackSynchronizableShellPlugin({ onBuildStart: { scripts: ['echo start'], blocking: true } })"},{"note":"Each lifecycle hook expects an object with scripts, blocking, parallel properties.","wrong":"onBuildStart: []  // directly passing array","symbol":"configuration structure","correct":"onBuildStart: { scripts: [], blocking: false, parallel: false }"}],"quickstart":{"code":"const WebpackSynchronizableShellPlugin = require('webpack-synchronizable-shell-plugin');\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: { path: __dirname + '/dist', filename: 'bundle.js' },\n  plugins: [\n    new WebpackSynchronizableShellPlugin({\n      onBuildStart: {\n        scripts: ['echo \"Build starting...\"'],\n        blocking: true,\n        parallel: false\n      },\n      onBuildEnd: {\n        scripts: ['echo \"Build complete\"'],\n        blocking: false,\n        parallel: true\n      },\n      onBuildExit: {\n        scripts: ['echo \"Done\"'],\n        blocking: false,\n        parallel: false\n      },\n      dev: true,\n      safe: false\n    })\n  ]\n};","lang":"javascript","description":"Shows typical setup with three lifecycle hooks, blocking/parallel options, and plugin instantiation in webpack config."},"warnings":[{"fix":"Set at most one to true; if both needed, use sequential scripts or separate hooks.","message":"Combining blocking:true with parallel:true is not supported; behavior undefined.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Wrap scripts in onBuildStart/onBuildEnd/onBuildExit objects.","message":"API differs from webpack-shell-plugin; direct scripts array is not accepted.","severity":"breaking","affected_versions":"0.0.0 - 0.0.7"},{"fix":"Remove 'verbose' from configuration.","message":"Option 'verbose' is deprecated and has no effect.","severity":"deprecated","affected_versions":">=0.0.7"},{"fix":"Use onBuildEnd for post-compilation tasks if you want to avoid repeated exit hooks.","message":"onBuildExit fires during watch mode after each compilation; not just on process exit.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Wrap scripts array inside an object, e.g., onBuildStart: { scripts: ['...'], blocking: false, parallel: false }","cause":"Passing scripts directly to plugin constructor instead of inside an object under onBuildStart/onBuildEnd/onBuildExit.","error":"TypeError: Cannot read property 'scripts' of undefined"},{"fix":"Set safe:true to use exec instead of spawn, or provide full path to command.","cause":"Shell command not found or safe:false default (uses spawn) fails on some systems.","error":"Error: spawn ENOENT"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}