{"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,"search_vec":"'0.0.7':28 '2018':29,76 'abandon':73 'altern':39 'block':51 'browser':83 'build':19 'command':11 'commit':75 'control':45 'deploy':68 'develop':71 'execut':48 'exit':16 'fine':43 'fine-grain':42 'fork':21 'grain':44 'hmr':82 'hook':57 'javascript':77 'last':74 'latest':32 'lifecycl':56 'like':64 'lint':65 'note':70 'onbuildend':59 'onbuildexit':60 'onbuildstart':58 'option':54 'order':49 'parallel':53 'per':55 'plugin':4,7,26,80 'process':20 'provid':41 'releas':34 'run':9 'script':47,69,84 'seem':72 'serv':81 'shell':3,10,25,79 'sinc':37 'stabl':33 'suitabl':61 'synchroniz':2 'task':63 'test':66 'unlik':38 'updat':36 'version':27 'webpack':1,6,24,78 'webpack-shell-plugin':23","created_at":"2026-04-25T11:25:16.191873+00:00","updated_at":"2026-04-25T11:25:16.191873+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/Feiyang1/webpack-shell-plugin","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/webpack-synchronizable-shell-plugin","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}