Skip to content

docs: use --open #3508

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

Merged
merged 1 commit into from
Jul 3, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion examples/cli/compression/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ It is enabled by default.
To run this example, run this command in your console or terminal:

```console
npx webpack serve --open-target <url> --compress
npx webpack serve --open --compress
```

### What should happen
Expand Down
4 changes: 2 additions & 2 deletions examples/cli/default/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
This example demonstrates how to use `webpack-dev-server`.

```console
npx webpack serve --open-target
npx webpack serve --open
```

To run your app using an alternative config, use:

```console
npx webpack serve --open-target <url> --config alternative.config.js
npx webpack serve --open --config alternative.config.js
```

## What Should Happen
Expand Down
2 changes: 1 addition & 1 deletion examples/cli/history-api-fallback/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ support in `webpack-dev-server`, effectively asking the server to fallback to
`index.html` in the event that a requested resource cannot be found.

```shell
npx webpack serve --open-target <url> --history-api-fallback
npx webpack serve --open --history-api-fallback
```

_Note: some URLs don't work by default. For example; if the url contains a dot.
Expand Down
4 changes: 2 additions & 2 deletions examples/cli/hmr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ application is running, without a full reload of the page.
To run this example, run this command in your console or terminal:

```console
npx webpack serve --open-target <url> --hot
npx webpack serve --open --hot
```

## What Should Happen
Expand Down Expand Up @@ -36,7 +36,7 @@ You should also see the text on the page itself change to match your edits in
Enables Hot Module Replacement without page refresh as a fallback in case of build failures.

```console
npx webpack serve --open-target --hot only
npx webpack serve --open --hot only
```

## What Should Happen
Expand Down
14 changes: 7 additions & 7 deletions examples/cli/host-and-port/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@ will run. The `host` and `port` options allow for that.
### IPv4

```console
npx webpack serve --open-target <url> --port 5000 --host 0.0.0.0
npx webpack serve --open --port 5000 --host 0.0.0.0
```

### IPv6

_This also works with IPv6_

```console
npx webpack serve --open-target <url> --port 5000 --host ::
npx webpack serve --open --port 5000 --host ::
```

### local-ip

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.

```console
npx webpack serve --open-target <url> --port 5000 --host local-ip
npx webpack serve --open --port 5000 --host local-ip
```

### local-ipv4

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

```console
npx webpack serve --open-target <url> --port 5000 --host local-ipv4
npx webpack serve --open --port 5000 --host local-ipv4
```

### local-ipv6

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

```console
npx webpack serve --open-target <url> --port 5000 --host local-ipv6
npx webpack serve --open --port 5000 --host local-ipv6
```

#### What Should Happen
Expand All @@ -56,7 +56,7 @@ npx webpack serve --open-target <url> --port 5000 --host local-ipv6
Tell the server to connect to a specific port with the following:

```console
npx webpack serve --open-target <url> --port 9000
npx webpack serve --open --port 9000
```

#### What Should Happen
Expand All @@ -69,7 +69,7 @@ npx webpack serve --open-target <url> --port 9000
Specifying `auto` as `port` will try to connect the server to the default port `8080` and if not available it will automatically search for another free port.

```console
npx webpack serve --open-target <url> --port auto
npx webpack serve --open --port auto
```

#### What Should Happen
Expand Down
4 changes: 2 additions & 2 deletions examples/cli/https/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ You may choose to wish to run `webpack-dev-server` on `https`.
Use HTTPS protocol.

```console
npx webpack serve --open-target <url> --https
npx webpack serve --open --https
```

## https options
Expand All @@ -21,7 +21,7 @@ Customize `https` configuration with the following options:
- `--https-passphrase`: Passphrase for a pfx file.

```console
npx webpack serve --open-target <url> --https-key ./ssl/server.key --https-pfx ./ssl/server.pfx --https-cert ./ssl/server.crt --https-cacert ./ssl/ca.pem --https-passphrase webpack-dev-server
npx webpack serve --open --https-key ./ssl/server.key --https-pfx ./ssl/server.pfx --https-cert ./ssl/server.crt --https-cacert ./ssl/ca.pem --https-passphrase webpack-dev-server
```

## What Should Happen
Expand Down
2 changes: 1 addition & 1 deletion examples/cli/multi-compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
`webpack-dev-server` should be able to compile multiple webpack configs.

```shell
npx webpack serve --open-target <url>
npx webpack serve --open
```

## What Should Happen
Expand Down
2 changes: 1 addition & 1 deletion examples/cli/node-false/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CLI: Webpack `node` Option

```shell
npx webpack serve --open-target <url>
npx webpack serve --open
```

## What should happen
Expand Down
2 changes: 1 addition & 1 deletion examples/cli/overlay/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CLI: --client-overlay option

```shell
npx webpack serve --open-target <url> --client-overlay
npx webpack serve --open --client-overlay
```

## What Should Happen
Expand Down
2 changes: 1 addition & 1 deletion examples/cli/progress/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CLI: Progress Option

```shell
npx webpack serve --open-target default generated URL in different browsers --client-progress
npx webpack serve --open --client-progress
```

## What Should Happen
Expand Down
6 changes: 3 additions & 3 deletions examples/cli/watch-static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Watching a single directory

```console
npx webpack serve --static assets --open-target <url>
npx webpack serve --static assets --open
```

### What Should Happen
Expand All @@ -26,13 +26,13 @@ module.exports = {
```

```console
npx webpack serve --open-target <url>
npx webpack serve --open
```

or via CLI only:

```console
npx webpack serve --static assets --static css --open-target <url>
npx webpack serve --static assets --static css --open
```

### What Should Happen
Expand Down
4 changes: 2 additions & 2 deletions examples/cli/web-server-socket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ To create a custom server implementation.
This mode uses [SockJS-node](https://github.com/sockjs/sockjs-node) as a server.

```console
npx webpack serve --web-socket-server sockjs --open-target <url>
npx webpack serve --web-socket-server sockjs --open
```

## ws

This mode uses [ws](https://github.com/websockets/ws) as a server.

```console
npx webpack serve --web-socket-server ws --open-target <url>
npx webpack serve --web-socket-server ws --open
```

### What Should Happen
Expand Down
2 changes: 1 addition & 1 deletion examples/cli/web-socket-url-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CLI: Web Socket URL

```console
npx webpack serve --open-target <url> --host 0.0.0.0 --client-web-socket-url ws://<insert-host>:8080
npx webpack serve --open --host 0.0.0.0 --client-web-socket-url ws://<insert-host>:8080
```

_NOTE: replace `<insert-host>` with your local IP Address._
Expand Down
2 changes: 1 addition & 1 deletion examples/general/config-array/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This example demonstrates using a `webpack` config containing an array of configs.

```console
npx webpack serve --open-target
npx webpack serve --open
```

## What Should Happen
Expand Down
2 changes: 1 addition & 1 deletion examples/general/config-promise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example demonstrates using `webpack-dev-server` with a `webpack` config tha
returns a `Promise`.

```console
npx webpack serve --open-target
npx webpack serve --open
```

## What Should Happen
Expand Down
2 changes: 1 addition & 1 deletion examples/general/proxy-advanced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This example demonstrates a user case whereby the app proxies all urls that star
`http://jsonplaceholder.typicode.com/users`.

```console
npx webpack serve --open-target
npx webpack serve --open
```

## What should happen
Expand Down
2 changes: 1 addition & 1 deletion examples/general/proxy-hot-reload/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# General: Proxy Hot Reload

```shell
npx webpack serve --open-target
npx webpack serve --open
```

Enables hot reloading for proxy config. If function is provided instead of
Expand Down
2 changes: 1 addition & 1 deletion examples/general/proxy-simple/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# General: Simple Proxy

```console
npx webpack serve --open-target
npx webpack serve --open
```

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.
Expand Down
2 changes: 1 addition & 1 deletion examples/general/universal-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This example demonstrates using a `webpack` config containing a `target: web` config and `target:node` config.

```console
npx webpack serve --open-target
npx webpack serve --open
```

## What Should Happen
Expand Down