Skip to content

Update dev-server.rst #14037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2020
Merged
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
17 changes: 9 additions & 8 deletions frontend/encore/dev-server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ While developing, instead of using ``yarn encore dev --watch``, you can use the

$ yarn encore dev-server

This serves the built assets from a new server at ``http://localhost:8080`` (it does
not actually write any files to disk). This means your ``script`` and ``link`` tags
need to change to point to this.

If you're using the ``encore_entry_script_tags()`` and ``encore_entry_link_tags()``
Twig shortcuts (or are :ref:`processing your assets through entrypoints.json <load-manifest-files>`
in some other way), you're done: the paths in your templates will automatically point
to the dev server.
This builds and serves the front-end assets from a new server. This server runs at
``localhost:8080`` by default, meaning your build assets are available at ``localhost:8080/build``.
This server does not actually write the files to disk; instead it servers them from memory,
allowing for hot module reloading.

As a consequence, the ``link`` and ``script`` tags need to point to the new server. If you're using the
``encore_entry_script_tags()`` and ``encore_entry_link_tags()`` Twig shortcuts (or are
:ref:`processing your assets through entrypoints.json <load-manifest-files>` in some other way),
you're done: the paths in your templates will automatically point to the dev server.

The ``dev-server`` command supports all the options defined by `webpack-dev-server`_.
You can set these options via command line options:
Expand Down