{"id":13646873,"url":"https://github.com/webpack-contrib/webpack-command","last_synced_at":"2025-04-21T21:31:38.503Z","repository":{"id":66001278,"uuid":"122840320","full_name":"webpack-contrib/webpack-command","owner":"webpack-contrib","description":"[DEPRECATED] Lightweight, modular, and opinionated webpack CLI that provides a superior experience","archived":true,"fork":false,"pushed_at":"2018-09-11T11:43:21.000Z","size":796,"stargazers_count":212,"open_issues_count":0,"forks_count":21,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-09T10:04:10.280Z","etag":null,"topics":["cli","command","command-line","webpack","webpack4"],"latest_commit_sha":null,"homepage":"","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/webpack-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-25T13:50:50.000Z","updated_at":"2025-03-03T14:52:56.000Z","dependencies_parsed_at":"2023-02-23T03:01:08.192Z","dependency_job_id":null,"html_url":"https://github.com/webpack-contrib/webpack-command","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fwebpack-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fwebpack-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fwebpack-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fwebpack-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webpack-contrib","download_url":"https://codeload.github.com/webpack-contrib/webpack-command/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250136749,"owners_count":21380885,"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":["cli","command","command-line","webpack","webpack4"],"created_at":"2024-08-02T01:03:12.441Z","updated_at":"2025-04-21T21:31:38.104Z","avatar_url":"https://github.com/webpack-contrib.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/webpack/webpack\"\u003e\n    \u003cimg width=\"200\" height=\"200\" src=\"https://webpack.js.org/assets/icon-square-big.svg\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![deps][deps]][deps-url]\n[![tests][tests]][tests-url]\n[![coverage][cover]][cover-url]\n[![chat][chat]][chat-url]\n[![size][size]][size-url]\n\n# webpack-command\n\nDEPRECATED. Please use `webpack-cli`. If any features were not implemented in `webpack-cli` feel free to create issue. \n\nWhy deprecated `webpack-command` ?\n- `webpack-cli` is very stable and have more features.\n- Two CLIs are misleading for developers.\n- Hard to maintain two package with same purpose.\n- The author stopped developing the package.\n- Most of the features are already implemented in `webpack-cli`.\n\nThanks for using `webpack`! We apologize for the inconvenience. In the future, we will avoid such situations.\n\n_____\n\nA superior CLI experience for webpack. Lightweight, modular, and opinionated.\n\nFor users coming from `webpack-cli`, please read about\n[the differences](#differences-with-webpack-cli) between this module and\n`webpack-cli`.\n\n## Requirements\n\nThis module requires a minimum of Node v6.14.0 and Webpack v4.0.0.\n\n`webpack-command` and `webpack-cli` cannot be installed at the same time, as\nthey both export a bin file named `webpack`. When trying `webpack-command`,\nplease `npm uninstall webpack-cli` first.\n\n## Benefits\n\n`webpack-command` has many advantages over other CLI experiences for `webpack`.\nThese include:\n\n- [Extendable Webpack Configurations](#extendable-webpack-configurations). A\nconfiguration file can extend the properties and collections from base\nconfigurations, and are filtered intelligently.\n- Custom Reporters 🤯\n- A beautiful default user experience with output driven by\n[`webpack-stylish`](https://www.npmjs.com/package/webpack-stylish)\n- Support for `webpack` configuration in any language or compiler that provides\na `require` hook\n- Support for `webpack` configuration in `JSON`, `YAML`, or `JavaScript`\n- Validation of commands, entries, and flags before further execution\n- Extensible third-party commands. Include only what you need!\n- A full test suite with 220 tests and 95% coverage (so close to 100% 💪)\n- A ~~93%~~ 24% smaller package cost versus `webpack-cli` (it used to be 93%,\n  they got wise after _webpack-command_ was released)\n- Highly focused on the User Experience and detail\n\nAnd last but not least, Did-You-Mean suggestions for flags:\n\n\u003cimg width=\"427\" src=\"https://raw.githubusercontent.com/webpack-contrib/webpack-command/master/assets/did-you-mean.png\" alt=\"did you mean\"\u003e\n\n## Getting Started\n\nTo begin, you'll need to install `webpack-command`:\n\n```console\n$ npm install webpack-command --save-dev\n```\n\n## CLI\n\nThe primary binary for webpack-command is `wp` (because who doesn't like to save\nkeystrokes!?) Although, you may also use the `webpack` binary as per usual if\nyour setup installs this module _after_ webpack, and the two don't conflict.\n\n```console\n$ wp --help\n\n  A superior CLI experience for webpack. Lightweight, modular, and opinionated.\n\n  Usage\n    $ webpack [\u003cconfig\u003e, ...options]\n    $ webpack \u003centry-file\u003e [...\u003centry-file\u003e] \u003coutput-file\u003e\n    $ webpack \u003ccommand\u003e [...options]\n\n  Options\n    --context                     The root directory for resolving entry point and stats\n    --debug                       Switch loaders to debug mode\n    --devtool                     Enable devtool for better debugging experience.\n                                  e.g. --devtool eval-cheap-module-source-map\n    --entry                       The entry point\n    --help                        Show usage information and the options listed here\n    --log-level                   Limit all process console messages to a specific level and above\n                                  Levels: trace, debug, info, warn, error, silent\n    --log-time                    Instruct the logger for webpack-serve and dependencies to display a timestamp\n    --progress                    Instructs webpack to track and display build progress\n    --reporter                    Specifies the reporter to use for generating console output for a build\n    --require                     Preload one or more modules before loading the webpack configuration\n                                  Typically used for language-specific require hooks\n    --run-dev                     An alias for --debug --devtool eval-cheap-module-source-map --output-pathinfo\n    --run-prod                    An alias for --optimize-minimize --define process.env.NODE_ENV=\"production\"\n    --version                     Display the webpack-command version\n    --watch                       Watch the filesystem for changes\n\n  Advanced\n    --bail                        Abort the compilation on first error\n    --cache                       Enable in memory caching\n    --define                      Define any free var in the bundle\n    --hot                         Enables Hot Module Replacement\n    --plugin                      Load this plugin\n    --prefetch                    Prefetch this request\n                                  e.g. --prefetch ./file.js\n    --profile                     Profile the compilation and include information in stats\n    --provide                     Provide these modules as free vars in all modules\n                                  e.g. --provide.jQuery jquery\n    --records-input-path          Path to the records file (reading)\n    --records-output-path         Path to the records file (writing)\n    --records-path                Path to the records file\n    --target                      The targeted execution environment\n    --watch-aggregate-timeout     Timeout for gathering changes while watching\n    --watch-poll                  The polling interval for watching (also enable polling)\n    --watch-stdin                 Exit the process when stdin is closed\n\n  Configuration File\n    --config                      Path to the config file\n    --config-name                 Name of the config to use\n    --config-register             Deprecated. Please use --require.\n    --mode                        Specifies the build mode to use; development or production\n\n  Modules\n    --module-bind                 Bind an extension to a loader\n    --module-bind-post            Bind an extension to a postLoader\n    --module-bind-pre             Bind an extension to a preLoader\n\n  Optimization\n    --optimize-max-chunks         Try to keep the chunk count below a limit\n    --optimize-min-chunk-size     Try to keep the chunk size above a limit\n    --optimize-minimize           Minimize javascript and switches loaders to minimizing\n\n  Output\n    --output                      The output path and file for compilation assets\n    --output-chunk-filename       The output filename for additional chunks\n    --output-filename             The output filename of the bundle\n    --output-jsonp-function       The name of the JSONP function used for chunk loading\n    --output-library              Expose the exports of the entry point as library\n    --output-library-target       The type for exposing the exports of the entry point as library\n    --output-path                 The output path for compilation assets\n    --output-pathinfo             Include a comment with the request for every dependency (require, import, etc.)\n    --output-public-path          The public path for the assets\n    --output-source-map-filename  The output filename for the SourceMap\n\n  Resolver\n    --resolve-alias               Setup a module alias for resolving\n                                  e.g. --resolve-alias.jquery jquery.plugin\n    --resolve-extensions          Setup extensions that should be used to resolve modules\n                                  e.g. .es6,.js\n    --resolve-loader-alias        Setup a loader alias for resolving\n\n\n    For further documentation, visit https://webpack.js.org/api/cli\n\n  Commands\n    help\n    teach\n\n    Type `webpack help \u003ccommand\u003e` for more information\n```\n\nAs a convenience for alternative package managers, the `webpack-command` binary\nis also installed with this package.\n\n## Extendable Webpack Configurations\n\nThis module supports extending webpack configuration files with\n[ESLint-style](https://eslint.org/docs/user-guide/configuring#extending-configuration-files)\n`extends` functionality. This feature allows users to create a \"base\" config and\nin essence, \"inherit\" from that base config in a separate config. A bare-bones\nexample:\n\n```js\n// base.config.js\nmodule.exports = {\n  name: 'base',\n  mode: 'development',\n  plugins: [...]\n}\n```\n\n```js\n// webpack.config.js\nmodule.exports = {\n  extends: path.join(..., 'base-config.js'),\n  name: 'dev'\n```\n\nThe resulting configuration object would resemble:\n\n```js\n{\n  name: 'dev',\n  mode: 'development',\n  plugins: [...]\n}\n```\n\n[Read More about Extending Configuration Files](https://github.com/webpack-contrib/config-loader/blob/master/docs/EXTENDS.md)\n\n## Commands\n\n`webpack-command` allows users to extend the `webpack` CLI experience by\nincluding a few helpful built-in commands, and providing a means to develop\nthird-party commands.\n\n### Built-In Commands\n\n- [Help Command](docs/HelpCommand.md)\n- [Teach Command](docs/TeachCommand.md)\n\n## Flags\n\nFor more documentation on flags, please see the\n[`webpack-cli` documentation](https://webpack.js.org/api/cli/).\n\n## Differences With `webpack-cli`\n\nWhile this project aims for parity with `webpack-cli` in nearly all aspects,\nthere are some notable differences. Included in those differences is the note\nthat this module includes the bare minimum of commands to provide a `webpack`\nCLI. Commands like `init`, `migrate`, and `update` are relegated to separate,\nuser-installed modules.\n\nThat said, the following differences should also be noted:\n\n### The `--env` Flag is Nuked\n\n[Environment Variables](https://en.wikipedia.org/wiki/Environment_variable) have\nbeen around a very, very long time. `webpack-cli` chose to introduce a feature\nthat let users specify environment variables via a flag. This module does not\ninclude that feature. Instead, users should make use of environment variables\nthe traditional, standard way:\n\n`$ NEAT_VAR=woo webpack ...`\n\nAnd access the values via `process.env`. Alternatively, if users are in need of\ncross-platform environment variables, a tool such as\n[`cross-env`](https://www.npmjs.com/package/cross-env) should be leveraged.\n\n### Key=Value Pairs\n\nCertain flags passed in `webpack-cli` allow for a key-value pair for\npairing an alias with the alias value. e.g. `--entry name=file`. This module\nadopts a CLI-standard approach by using the syntax `--flag.key value` instead,\nand does not support the `key=value` syntax.\n\n### Entries\n\nSpecifying entries by either flag (`--flag`) or input (`webpack \u003cfile\u003e`) require\nthat the file or directory specified exist.\n\nEntries passed with a comma-separated value `--entry file,file2` are deprecated\nand should be migrated to use the CLI-standard `--entry file --entry file2`\nsyntax.\n\nEntries passed by flag in `webpack-cli` using `--entry name=file` should be\nmigrated to use the `--entry.name file` syntax.\n\n### Resolve Alias\n\nResolve aliases passed by flag in `webpack-cli` using\n`--resolve-alias alias=value` should be migrated to use the `--resolve-alias.{alias} {value}`\nsyntax.\n\n### Resolve Loader Alias\n\nResolve aliases passed by flag in `webpack-cli` using\n`--resolve-loader-alias alias=value` should be migrated to use the\n`--resolve-loader-alias.alias value` syntax.\n\n## Reporters\n\n`webpack-command` supports custom, user-defined reporters which allow users\nfull control over how build data is presented. By default, it ships with two\navailable reporters:\n\n#### `basic`\n\nDisplays the default `webpack` output, the same you'll see\nusing `webpack-cli`.\n\n#### `stylish`\n\nThe **default** reporter and displays beautiful output using the same code\nthat drives [`webpack-stylish`](https://www.npmjs.com/package/webpack-stylish).\n\nBuilding your own reporter is as easy as inheriting from the `Reporter` class\nlocated at `lib/reporters/Reporter.js`.\n\n## Configuration Languages and Compilers\n\n`webpack-command` allows users to leverage any language that provides a require\nhook. To leverage this feature, define your configs as such for the following\nlanguages/compilers:\n\n- Babel ES6 Modules: `webpack.config.js` or `webpack.config.es6`, and use\n`--require babel-register`\n- Flow: `webpack.config.js` or `webpack.config.flow`, and use\n`--require flow-remove-types/register`\n- TypeScript: `webpack.config.ts`, and use `--require ts-node/register`\n\nOther hooks may work for additional language or compiler support.\n\n_Note: Compilers are not part of, nor built-into this module. To use a specific\ncompiler, you must install it first._\n\n## Gotchas\n\nAny entry files specified will overwrite entries in a `webpack.config.js` file\nas of [this Pull Request](https://github.com/webpack/webpack-cli/pull/358) in\n`webpack-cli`.\n\n## Contributing\n\nPlease take a moment to read our contributing guidelines if you haven't yet done so.\n\n#### [CONTRIBUTING](./.github/CONTRIBUTING.md)\n\n## License\n\n#### [MIT](./LICENSE)\n\n[npm]: https://img.shields.io/npm/v/webpack-command.svg\n[npm-url]: https://npmjs.com/package/webpack-command\n\n[node]: https://img.shields.io/node/v/webpack-command.svg\n[node-url]: https://nodejs.org\n\n[deps]: https://david-dm.org/webpack-contrib/webpack-command.svg\n[deps-url]: https://david-dm.org/webpack-contrib/webpack-command\n\n[tests]: \thttps://img.shields.io/circleci/project/github/webpack-contrib/webpack-command.svg\n[tests-url]: https://circleci.com/gh/webpack-contrib/webpack-command\n\n[cover]: https://codecov.io/gh/webpack-contrib/webpack-command/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack-contrib/webpack-command\n\n[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg\n[chat-url]: https://gitter.im/webpack/webpack\n\n[size]: https://packagephobia.now.sh/badge?p=webpack-command\n[size-url]: https://packagephobia.now.sh/result?p=webpack-command\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack-contrib%2Fwebpack-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebpack-contrib%2Fwebpack-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack-contrib%2Fwebpack-command/lists"}