Skip to content

Commit f177cad

Browse files
authored
use --public parameter instead
1 parent 62f708f commit f177cad

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

frontend/encore/dev-server.rst

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,17 @@ to bind to all IP addresses and allow any host to access the server:
3232

3333
.. code-block:: terminal
3434
35-
$ ./node_modules/.bin/encore dev-server --host 0.0.0.0 --disable-host-check
35+
$ ./node_modules/.bin/encore dev-server --public http://docker-host:9000 --port 9000 --host 0.0.0.0 --disable-host-check
3636
3737
You can now access the dev-server using the IP address to your virtual machine on
38-
port 8080 - e.g. http://192.168.1.1:8080.
38+
port 9000 - e.g. http://192.168.1.1:9000.
3939
If you've activated the :ref:`manifest.json versioning <load-manifest-files>` you need additional configuration to alter the url used in your templates to the ``dev-server``:
4040

4141
.. code-block:: javascript
42+
Encore
43+
.setManifestKeyPrefix('build/')
4244
43-
if (!Encore.isProduction()) {
44-
Encore
45-
.setPublicPath('http://192.168.1.1:8080')
46-
.setManifestKeyPrefix('build/')
47-
}
48-
49-
You'll receive a warning, when starting the ``dev-server``, that you used an absolute url for the publicPath.
50-
51-
When you're using the ``dev-server`` in a docker container, configure accordingly and map the port from the ``dev-server`` (default 8080) onto a port on the host and provide this port on the host in the url used in the call to ``.setPublicPath`` above.
45+
When you're using the ``dev-server`` in a docker container, configure accordingly and bind the port from the ``dev-server`` (default 8080) onto a port on the host and provide this port --public parameter above.
5246

5347

5448
Hot Module Replacement HMR

0 commit comments

Comments
 (0)