Skip to content

Update advanced-config.rst to contain more information about multi encore-builds #11177

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

Closed
wants to merge 1 commit into from
Closed
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
21 changes: 21 additions & 0 deletions frontend/encore/advanced-config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,27 @@ prefer to build configs separately, pass the ``--config-name`` option:

$ yarn encore dev --config-name firstConfig

Now you can use the configurations by using

.. code-block:: terminal

webpack_encore:
output_path: '%kernel.public_dir%/public/default_build'
builds:
foo: '%kernel.public_dir%/public/foo_build'
bar: '%kernel.public_dir%/public/bar_build'

And in your templatefiles you can reference the builds with:

.. code-block:: terminal

{# Using the entrypoints.json file located in ./public/foo_build #}
{{ encore_entry_script_tags('foo_entry', null, 'foo') }}
{{ encore_entry_link_tags('foo_entry', null, 'foo') }}
{# Using the entrypoints.json file located in ./public/bar_build #}
{{ encore_entry_script_tags('bar_entry', null, 'bar') }}
{{ encore_entry_link_tags('bar_entry', null, 'bar') }}

Generating a Webpack Configuration Object without using the Command-Line Interface
----------------------------------------------------------------------------------

Expand Down