Skip to content

docs: improve cli docs #2815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@ There are two main, recommended methods of using the module:
The easiest way to use it is with the CLI. In the directory where your
`webpack.config.js` is, run:

> For webpack-cli 3.x:

```console
node_modules/.bin/webpack-dev-server
```

> For webpack-cli 4.x:

```console
node_modules/webpack-cli/bin/cli.js serve
```

_**Note**: Many CLI options are available with `webpack-dev-server`. Explore this [link](https://webpack.js.org/configuration/dev-server/)._

### With NPM Scripts
Expand All @@ -67,9 +75,19 @@ NPM package.json scripts are a convenient and useful means to run locally instal
binaries without having to be concerned about their full paths. Simply define a
script as such:

> For webpack-cli 3.x:

```json
"scripts": {
"start:dev": "webpack-dev-server",
}
```

> For webpack-cli 4.x:

```json
"scripts": {
"start:dev": "webpack-dev-server"
"start:dev": "webpack serve",
}
```

Expand Down