{"id":13671278,"url":"https://github.com/GSCBInc/webpack-cmd-shell-plugin","last_synced_at":"2025-04-27T14:33:15.479Z","repository":{"id":57409548,"uuid":"128594333","full_name":"GSCBInc/webpack-cmd-shell-plugin","owner":"GSCBInc","description":"Run flexible and configurable shell commands through each step of the webpack build process","archived":false,"fork":false,"pushed_at":"2018-04-23T20:27:39.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T03:34:02.972Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GSCBInc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-08T03:41:08.000Z","updated_at":"2019-02-17T13:59:26.000Z","dependencies_parsed_at":"2022-08-24T20:00:15.781Z","dependency_job_id":null,"html_url":"https://github.com/GSCBInc/webpack-cmd-shell-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSCBInc%2Fwebpack-cmd-shell-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSCBInc%2Fwebpack-cmd-shell-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSCBInc%2Fwebpack-cmd-shell-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSCBInc%2Fwebpack-cmd-shell-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GSCBInc","download_url":"https://codeload.github.com/GSCBInc/webpack-cmd-shell-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251154412,"owners_count":21544494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T09:01:04.846Z","updated_at":"2025-04-27T14:33:14.700Z","avatar_url":"https://github.com/GSCBInc.png","language":"JavaScript","readme":"# Webpack Command Shell Plugin\nRun flexible and configurable shell commands through each step of the webpack build process.\n\n## Installation\n\n`npm install --save-dev webpack-cmd-shell-plugin`\n\n## Setup\nIn `webpack.config.js`:\n\n```js\nconst WebpackShellPlugin = require('webpack-shell-plugin');\n\nmodule.exports = {\n    . . .\n    . . .\n    plugins: [\n        new WebpackCmdShellPlugin({\n            enforceOrder: true,\n            beforeStart: 'karma start',\n            whenDone: [\n                'npm version patch -m \"Incrementing app version to %s\"',\n                'git push origin HEAD',\n                'git push --tags'\n            ]\n        })\n    ]\n};\n```\n\n## Example\n\nInsert into your webpack.config.js:\n\n```js\nconst path = require('path');\nconst WebpackCmdShellPlugin = require('webpack-cmd-shell-plugin');\nconst WebpackCmdShellPluginConfig = new WebpackCmdShellPlugin({\n    enforceOrder: true,\n    beforeStart: 'echo Webpack is starting up',\n    beforeCompile: 'echo Webpack is starting a compile stage',\n    afterCompile: 'echo Webpack has finished compiling stage',\n    onEmit: 'echo Webpack is emitting files',\n    afterEmit: 'echo Webpack has finished emitting files',\n    whenDone: [\n        'echo Attempting to run npm version patch next',\n        'npm version patch --no-git-tag-version',\n        'echo Webpack has finished building'\n    ]\n});\n\nmodule.exports = {\n    entry: {\n        app: path.resolve(__dirname, 'src/app.js')\n    },\n    output: {\n        path: path.resolve(__dirname, 'dist'),\n        filename: 'bundle.js'\n    },\n    module: {\n        rules: [{\n            test: /\\.js$/,\n            exclude: /node_modules/,\n            use: {\n                loader: 'babel-loader',\n                options: {\n                    presets: ['es2015']\n                }\n            }\n        }]\n    }\n    plugins: [WebpackCmdShellPluginConfig]\n};\n```\n\n### API\n* `beforeStart`: script or array of scripts that are executed before webpack starts building.\n* `beforeCompile`: script or array of scripts that are executed before webpack starts compiling a bundle of assets\n* `afterCompile`: script or array of scripts that are executed after webpack finishes compiling a bundle of assets\n* `onEmit`: script or array of scripts that are executed when webpack starts emitting files\n* `afterEmit`: script or array of scripts that are executed when webpack finishes emitting files\n* `whenDone`: script or array of scripts that are executed when webpack finishes building\n* `enforceOrder`: ensures that an array of scripts for a certain build process are executed in order **Default: false**\n\n### Developing\nIf 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\n\nExample: `git commit -m \"Fixing typo within documentation #18\"`\n\n### Contributors\nChristopher Thaw\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGSCBInc%2Fwebpack-cmd-shell-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGSCBInc%2Fwebpack-cmd-shell-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGSCBInc%2Fwebpack-cmd-shell-plugin/lists"}