Skip to content

Commit

Permalink
Configuration for versioning, when rebinding the host from dev-server…
Browse files Browse the repository at this point in the history
… to all interfaces

This is the discussion, for setting an absolute url as publicPath, when you're binding the dev server not to localhost but to any external interface (0.0.0.0) and disable host checking.

This is the related discussion:
symfony/webpack-encore#96

best regards
philipp
  • Loading branch information
pscheit committed Feb 26, 2018
1 parent c831050 commit 62f708f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions frontend/encore/dev-server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ to bind to all IP addresses and allow any host to access the server:
You can now access the dev-server using the IP address to your virtual machine on
port 8080 - e.g. http://192.168.1.1:8080.
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``:

.. code-block:: javascript
if (!Encore.isProduction()) {
Encore
.setPublicPath('http://192.168.1.1:8080')
.setManifestKeyPrefix('build/')
}
You'll receive a warning, when starting the ``dev-server``, that you used an absolute url for the publicPath.

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.


Hot Module Replacement HMR
--------------------------
Expand Down

0 comments on commit 62f708f

Please sign in to comment.