You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configuration for versioning, when rebinding the host from dev-server 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
Copy file name to clipboardExpand all lines: frontend/encore/dev-server.rst
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,20 @@ to bind to all IP addresses and allow any host to access the server:
36
36
37
37
You can now access the dev-server using the IP address to your virtual machine on
38
38
port 8080 - e.g. http://192.168.1.1:8080.
39
+
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``:
40
+
41
+
.. code-block:: javascript
42
+
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.
0 commit comments