Skip to content

Commit 1d0599a

Browse files
committed
minor #11177 Update advanced-config.rst to contain more information about multi encore-builds (zbrag)
This PR was submitted for the 4.2 branch but it was merged into the 3.4 branch instead (closes #11177). Discussion ---------- Update advanced-config.rst to contain more information about multi encore-builds It took me some time to find symfony/webpack-encore#477 , so I guess it would be better to add it to the official documentation. Commits ------- 954b398 Update advanced-config.rst
2 parents f5f0fb6 + 954b398 commit 1d0599a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

frontend/encore/advanced-config.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,27 @@ prefer to build configs separately, pass the ``--config-name`` option:
100100
101101
$ yarn encore dev --config-name firstConfig
102102
103+
Now you can use the configurations by using
104+
105+
.. code-block:: terminal
106+
107+
webpack_encore:
108+
output_path: '%kernel.public_dir%/public/default_build'
109+
builds:
110+
foo: '%kernel.public_dir%/public/foo_build'
111+
bar: '%kernel.public_dir%/public/bar_build'
112+
113+
And in your templatefiles you can reference the builds with:
114+
115+
.. code-block:: terminal
116+
117+
{# Using the entrypoints.json file located in ./public/foo_build #}
118+
{{ encore_entry_script_tags('foo_entry', null, 'foo') }}
119+
{{ encore_entry_link_tags('foo_entry', null, 'foo') }}
120+
{# Using the entrypoints.json file located in ./public/bar_build #}
121+
{{ encore_entry_script_tags('bar_entry', null, 'bar') }}
122+
{{ encore_entry_link_tags('bar_entry', null, 'bar') }}
123+
103124
Generating a Webpack Configuration Object without using the Command-Line Interface
104125
----------------------------------------------------------------------------------
105126

0 commit comments

Comments
 (0)