Skip to content

Commit 87aa44f

Browse files
authored
docs(guides): update development-vagrant guide (webpack#5429)
1 parent a9812a9 commit 87aa44f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/guides/development-vagrant.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Vagrant.configure("2") do |config|
2020
end
2121
```
2222

23-
Next, install `webpack` and `webpack-dev-server` in your project;
23+
Next, install `webpack`, `webpack-cli`, `@webpack-cli/serve`, and `webpack-dev-server` in your project;
2424

2525
```bash
26-
npm install --save-dev webpack webpack-dev-server
26+
npm install --save-dev webpack webpack-cli @webpack-cli/serve webpack-dev-server
2727
```
2828

2929
Make sure to have a `webpack.config.js` file. If you haven't already, use this as a minimal example to get started:
@@ -56,15 +56,15 @@ Note that you also need to create an `app.js` file.
5656
Now, let's run the server:
5757

5858
```bash
59-
webpack serve --host 0.0.0.0 --public 10.10.10.61:8080 --watch-poll
59+
webpack serve --host 0.0.0.0 --client-web-socket-url ws://10.10.10.61:8080/ws --watch-options-poll
6060
```
6161

6262
By default, the server will only be accessible from localhost. We'll be accessing it from our host PC, so we need to change `--host` to allow this.
6363

6464
`webpack-dev-server` will include a script in your bundle that connects to a WebSocket to reload when a change in any of your files occurs.
65-
The `--public` flag makes sure the script knows where to look for the WebSocket. The server will use port `8080` by default, so we should also specify that here.
65+
The `--client-web-socket-url` flag makes sure the script knows where to look for the WebSocket. The server will use port `8080` by default, so we should also specify that here.
6666

67-
`--watch-poll` makes sure that webpack can detect changes in your files. By default, webpack listens to events triggered by the filesystem, but VirtualBox has many problems with this.
67+
`--watch-options-poll` makes sure that webpack can detect changes in your files. By default, webpack listens to events triggered by the filesystem, but VirtualBox has many problems with this.
6868

6969
The server should be accessible on `http://10.10.10.61:8080` now. If you make a change in `app.js`, it should live reload.
7070

@@ -96,7 +96,7 @@ The `proxy_set_header` lines are important, because they allow the WebSockets to
9696
The command to start `webpack-dev-server` can then be changed to this:
9797

9898
```bash
99-
webpack serve --public 10.10.10.61 --watch-poll
99+
webpack serve --client-web-socket-url ws://10.10.10.61:8080/ws --watch-options-poll
100100
```
101101

102102
This makes the server only accessible on `127.0.0.1`, which is fine because nginx takes care of making it available on your host PC.

0 commit comments

Comments
 (0)