Skip to content

Commit 07f6c99

Browse files
committed
docs: update examples
1 parent 84e1d34 commit 07f6c99

File tree

24 files changed

+34
-45
lines changed

24 files changed

+34
-45
lines changed

examples/cli/bonjour/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ is started.
66
To run this example, run this command in your console or terminal:
77

88
```console
9-
npm run webpack-dev-server -- --bonjour
9+
npx webpack serve --bonjour
1010
```
1111

1212
## What Should Happen
@@ -33,7 +33,7 @@ module.exports = {
3333
```
3434

3535
```console
36-
npm run webpack-dev-server -- --config webpack.config.js
36+
npx webpack serve --config webpack.config.js
3737
```
3838

3939
## What Should Happen

examples/cli/compression/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ It is enabled by default.
1010
To run this example, run this command in your console or terminal:
1111

1212
```console
13-
npm run webpack-dev-server -- --open-target --compress
13+
npx webpack serve --open-target --compress
1414
```
1515

1616
### What should happen
@@ -25,7 +25,7 @@ npm run webpack-dev-server -- --open-target --compress
2525
To run this example, run this command in your console or terminal:
2626

2727
```console
28-
npm run webpack-dev-server -- --open --no-compress
28+
npx webpack serve --open --no-compress
2929
```
3030

3131
### What should happen

examples/cli/default/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
This example demonstrates how to use `webpack-dev-server`.
44

55
```console
6-
npm run webpack-dev-server -- --open-target
6+
npx webpack serve --open-target
77
```
88

99
To run your app using an alternative config, use:
1010

1111
```console
12-
npm run webpack-dev-server -- --open-target --config alternative.config.js
12+
npx webpack serve --open-target --config alternative.config.js
1313
```
1414

1515
## What Should Happen

examples/cli/history-api-fallback/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ support in `webpack-dev-server`, effectively asking the server to fallback to
55
`index.html` in the event that a requested resource cannot be found.
66

77
```shell
8-
npm run webpack-dev-server -- --open-target --history-api-fallback
8+
npx webpack serve --open-target --history-api-fallback
99
```
1010

1111
_Note: some URLs don't work by default. For example; if the url contains a dot.

examples/cli/hmr/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ application is running, without a full reload of the page.
66
To run this example, run this command in your console or terminal:
77

88
```console
9-
npm run webpack-dev-server -- --open-target --hot
9+
npx webpack serve --open-target --hot
1010
```
1111

1212
## What Should Happen

examples/cli/host-and-port/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,39 @@ will run. The `host` and `port` options allow for that.
66
## IPv4
77

88
```console
9-
npm run webpack-dev-server -- --open-target --port 5000 --host 0.0.0.0
9+
npx webpack serve --open-target --port 5000 --host 0.0.0.0
1010
```
1111

1212
## IPv6
1313

1414
_This also works with IPv6_
1515

1616
```console
17-
npm run webpack-dev-server -- --open-target --port 5000 --host ::
17+
npx webpack serve --open-target --port 5000 --host ::
1818
```
1919

2020
## local-ip
2121

2222
Specifying `local-ip` as `host` will try to resolve the `host` option as your local `IPv4` address if available, if `IPv4` is not available it will try to resolve your local `IPv6` address.
2323

2424
```console
25-
npm run webpack-dev-server -- --open-target --port 5000 --host local-ip
25+
npx webpack serve --open-target --port 5000 --host local-ip
2626
```
2727

2828
## local-ipv4
2929

3030
Specifying `local-ipv4` as `host` will try to resolve the `host` option as your local `IPv4` address.
3131

3232
```console
33-
npm run webpack-dev-server -- --open-target --port 5000 --host local-ipv4
33+
npx webpack serve --open-target --port 5000 --host local-ipv4
3434
```
3535

3636
## local-ipv6
3737

3838
Specifying `local-ipv6` as `host` will try to resolve the `host` option as your local `IPv6` address.
3939

4040
```console
41-
npm run webpack-dev-server -- --open-target --port 5000 --host local-ipv6
41+
npx webpack serve --open-target --port 5000 --host local-ipv6
4242
```
4343

4444
## What Should Happen

examples/cli/multi-compiler/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
`webpack-dev-server` should be able to compile multiple webpack configs.
44

55
```shell
6-
npm run webpack-dev-server -- --open-target
6+
npx webpack serve --open-target
77
```
88

99
## What Should Happen

examples/cli/node-false/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CLI: Webpack `node` Option
22

33
```shell
4-
npm run webpack-dev-server -- --open-target
4+
npx webpack serve --open-target
55
```
66

77
## What should happen

examples/cli/open-target-multiple/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CLI: Open Target Option (Multiple)
22

33
```console
4-
npm run webpack-dev-server -- --open-target example1.html --open-target example2.html
4+
npx webpack serve --open-target example1.html --open-target example2.html
55
```
66

77
Some applications may consist of multiple pages. During development it may

examples/cli/open-target/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
Open browser:
44

55
```
6-
npm run webpack-dev-server -- --open-target
6+
npx webpack serve --open-target
77
```
88

99
Open specific page in browser:
1010

1111
```
12-
npm run webpack-dev-server -- --open-target /example.html#page1
12+
npx webpack serve --open-target /example.html#page1
1313
```
1414

1515
Open specific browser:
1616

1717
```
18-
npm run webpack-dev-server -- --open-app firefox
18+
npx webpack serve --open-app firefox
1919
```
2020

2121
Open specific page in specific browser:
2222

2323
```
24-
npm run webpack-dev-server -- --open-target example.html#page1 --open-app firefox
24+
npx webpack serve --open-target example.html#page1 --open-app firefox
2525
```
2626

2727
Some applications may consist of multiple pages. During development it may

examples/cli/overlay/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CLI: --client-overlay option
22

33
```shell
4-
npm run webpack-dev-server -- --open-target --client-overlay
4+
npx webpack serve --open-target --client-overlay
55
```
66

77
## What Should Happen

examples/cli/progress/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CLI: Progress Option
22

33
```shell
4-
npm run webpack-dev-server -- --open-target --client-progress
4+
npx webpack serve --open-target --client-progress
55
```
66

77
## What Should Happen

examples/cli/public-protocol/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CLI: Public Option Protocol
22

33
```console
4-
npm run webpack-dev-server
4+
npx webpack serve
55
```
66

77
_NOTE: replace `<insert local ip>` with your local IP Address._

examples/cli/public/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CLI: Public Option
22

33
```console
4-
npm run webpack-dev-server -- --open-target --host 0.0.0.0 --public <insert local ip>:8080
4+
npx webpack serve --open-target --host 0.0.0.0 --public <insert local ip>:8080
55
```
66

77
_NOTE: replace `<insert local ip>` with your local IP Address._

examples/cli/watch-static/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Watching a single directory
44

55
```console
6-
npm run webpack-dev-server -- --static assets --open-target
6+
npx webpack serve --static assets --open-target
77
```
88

99
### What Should Happen
@@ -26,13 +26,13 @@ module.exports = {
2626
```
2727

2828
```console
29-
npm run webpack-dev-server -- --open-target
29+
npx webpack serve --open-target
3030
```
3131

3232
or via CLI only:
3333

3434
```console
35-
npm run webpack-dev-server -- --static assets --static css --open-target
35+
npx webpack serve --static assets --static css --open-target
3636
```
3737

3838
### What Should Happen

examples/general/config-array/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This example demonstrates using a `webpack` config containing an array of configs.
44

55
```console
6-
npm run webpack-dev-server -- --open
6+
npx webpack serve --open-target
77
```
88

99
## What Should Happen

examples/general/config-promise/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This example demonstrates using `webpack-dev-server` with a `webpack` config tha
44
returns a `Promise`.
55

66
```console
7-
npm run webpack-dev-server -- --open
7+
npx webpack serve --open-target
88
```
99

1010
## What Should Happen

examples/general/proxy-advanced/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This example demonstrates a user case whereby the app proxies all urls that star
66
`http://jsonplaceholder.typicode.com/users`.
77

88
```console
9-
npm run webpack-dev-server -- --open
9+
npx webpack serve --open-target
1010
```
1111

1212
## What should happen

examples/general/proxy-hot-reload/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# General: Proxy Hot Reload
22

33
```shell
4-
npm run webpack-dev-server -- --open
4+
npx webpack serve --open-target
55
```
66

77
Enables hot reloading for proxy config. If function is provided instead of

examples/general/proxy-simple/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# General: Simple Proxy
22

33
```console
4-
npm run webpack-dev-server -- --open
4+
npx webpack serve --open-target
55
```
66

77
In `webpack.config.js` there is a very simple configuration for a proxy. Note that this only works when proxying to a direct ip address. See the proxy-advanced example if you want to proxy to a domain.

examples/general/universal-config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This example demonstrates using a `webpack` config containing a `target: web` config and `target:node` config.
44

55
```console
6-
npm run webpack-dev-server -- --open
6+
npx webpack serve --open-target
77
```
88

99
## What Should Happen

examples/general/webworker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This example demonstrates using a WebWorker within an app run by `webpack-dev-server`.
44

55
```console
6-
npm run webpack-dev-server
6+
npx webpack serve
77
```
88

99
## What should happen

examples/run-example.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"pretest": "npm run lint",
3030
"prepare": "npm run build:client && husky install",
3131
"build:client": "rimraf ./client/* && babel client-src/ --out-dir client/ --ignore \"webpack.config.js\" && webpack --config client/webpack.config.js",
32-
"webpack-dev-server": "node examples/run-example.js",
3332
"release": "standard-version"
3433
},
3534
"dependencies": {

0 commit comments

Comments
 (0)