Skip to content
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
6 changes: 3 additions & 3 deletions src/content/guides/development-vagrant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ Note that you also need to create an `app.js` file.
Now, let's run the server:

```bash
webpack serve --host 0.0.0.0 --public 10.10.10.61:8080 --watch-poll
webpack serve --host 0.0.0.0 --client-web-socket-url 10.10.10.61:8080 --watch-poll
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think we need to update --watch-poll to --watch-options-poll everywhere.

Suggested change
webpack serve --host 0.0.0.0 --client-web-socket-url 10.10.10.61:8080 --watch-poll
webpack serve --host 0.0.0.0 --client-web-socket-url 10.10.10.61:8080 --watch-options-poll

```

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.

`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.
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.
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.

`--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.

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

```bash
webpack serve --public 10.10.10.61 --watch-poll
webpack serve --client-web-socket-url 10.10.10.61 --watch-poll
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally it should be wss://hostname:port/ws, because it is full url

```

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.
Expand Down