cytopia / cytopia/devilbox

Webpack Dev Server with Devilbox

Open
#782 14 comments 0 reactions 1 assignee Claimed by @cytopia View on GitHub
documentation websocket
Dominant language
PHP
Stars
4.5k
Forks
652
PR merge metrics
No merged PRs in 30d

Description

#### ISSUE TYPE

- Documentation

#### SUMMARY
As webpack-dev-server gets more popular and is also a big part of Symfony's webpack encore, I would kindly ask for a proper documentation of a correct setup.

Currently I need to add the following:

`docker-compose.override.yml`
```
version: '2.3'

################################################################################
# SERVICES
################################################################################
services:

# .....

# ------------------------------------------------------------
# PHP
# ------------------------------------------------------------
php:
ports:
- "8080:8080"
```

`webpack.config.js`
```
.configureDevServerOptions(options => {
options.client = {
host: '0.0.0.0'
};
options.firewall = false;
options.https = true;
})
```

and also the starting command needs to be: `encore dev-server --https --host 0.0.0.0`

`package.json`
```
...
"scripts": {
"dev-server": "encore dev-server --host 0.0.0.0 --https",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
}
...

```

Problems with this setup:

- SSL connection is always invalid. Adding the devilbox certificates to the `https: { ... }` options object does not work
- `host` needs to be included in the yarn command to start the server, else it tries to use localhost
- also `client.host` needs to be specified somewhat redundantly to make the web socket working

Webpack Encore 1.0.4
Webpack 5.20.1
Webpack-dev-server: 4.0.0-beta.0
Devilbox 1.7.1

Also see: https://github.com/symfony/webpack-encore/issues/828

#### Goal
Add a documentation guide for proper implementation of webpack-dev-server.

- working SSL connection
- probably with an per project `webpack-dev-server` (wds)? (starting `wds` in multiple projects simultaneously leads to problems

Would highly appreciate! Thank you for the great devilbox!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.