You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Covers what completes, that `@bomb.sh/tab` has to be installed for it, and
the line to add per shell. Also lists `complete` among the commands in both
readmes, the second of which quotes `--help` and so has to match it.
Co-authored-by: AmirSa12 <amirhosseinpr184@gmail.com>
Copy file name to clipboardExpand all lines: README.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@
26
26
-[Packages](#packages)
27
27
-[Commands](#commands)
28
28
-[Getting started](#getting-started)
29
+
-[Shell completion](#shell-completion)
29
30
-[Exit codes and their meanings](#exit-codes-and-their-meanings)
30
31
-[Contributing and Internal Documentation](#contributing-and-internal-documentation)
31
32
-[Funding](#funding)
@@ -58,6 +59,7 @@ Supporting developers is an important task for webpack CLI.
58
59
Thus, webpack CLI provides different commands for many common tasks.
59
60
60
61
-[`build|bundle|b [entries...] [options]`](https://webpack.js.org/api/cli/#build) - Run webpack (default command, can be omitted).
62
+
-`complete [shell]` - Print a shell completion script, see [Shell completion](#shell-completion).
61
63
-[`configtest|t [config-path]`](https://webpack.js.org/api/cli/#configtest) - Validate a webpack configuration.
62
64
-[`help|h [command] [option]`](https://webpack.js.org/api/cli/#help) - Display help for commands and options.
63
65
-[`info|i [options]`](https://webpack.js.org/api/cli/#info) - Returns information related to the local environment.
@@ -79,6 +81,41 @@ npx create-webpack-app init
79
81
80
82
You will then be prompted for some questions about which features you want to use, such as `scss`, `typescript`, `PWA` support or other features.
81
83
84
+
## Shell completion
85
+
86
+
Commands, their options and the values those options accept can be completed in `zsh`, `bash`, `fish` and `powershell`. The completions are read from webpack's own schema, so they cover whatever your webpack and `webpack-dev-server` versions support.
87
+
88
+
Completion is served by [`@bomb.sh/tab`](https://www.npmjs.com/package/@bomb.sh/tab), which is optional and not installed with `webpack-cli`:
89
+
90
+
```sh
91
+
npm install --save-dev @bomb.sh/tab
92
+
```
93
+
94
+
Then load the script for your shell:
95
+
96
+
```sh
97
+
# zsh
98
+
echo'source <(webpack complete zsh)'>>~/.zshrc
99
+
100
+
# bash
101
+
echo'source <(webpack complete bash)'>>~/.bashrc
102
+
103
+
# fish
104
+
webpack complete fish >~/.config/fish/completions/webpack.fish
0 commit comments