Skip to content

Commit dd92f7a

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: Update advanced-config.rst
2 parents 2574794 + e2bfb67 commit dd92f7a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

frontend/encore/advanced-config.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,30 @@ prefer to build configs separately, pass the ``--config-name`` option:
100100
101101
$ yarn encore dev --config-name firstConfig
102102
103+
Next, define the output directories of each build:
104+
105+
.. code-block:: yaml
106+
107+
# config/packages/webpack_encore.yaml
108+
webpack_encore:
109+
output_path: '%kernel.public_dir%/web/default_build'
110+
builds:
111+
firstConfig: '%kernel.public_dir%/web/first_build'
112+
secondConfig: '%kernel.public_dir%/web/second_build'
113+
114+
Finally, use the third optional parameter of the ``encore_entry_*_tags()``
115+
functions to specify which build to use:
116+
117+
.. code-block:: twig
118+
119+
{# Using the entrypoints.json file located in ./web/first_build #}
120+
{{ encore_entry_script_tags('app', null, 'firstConfig') }}
121+
{{ encore_entry_link_tags('global', null, 'firstConfig') }}
122+
123+
{# Using the entrypoints.json file located in ./web/second_build #}
124+
{{ encore_entry_script_tags('mobile', null, 'secondConfig') }}
125+
{{ encore_entry_link_tags('mobile', null, 'secondConfig') }}
126+
103127
Generating a Webpack Configuration Object without using the Command-Line Interface
104128
----------------------------------------------------------------------------------
105129

0 commit comments

Comments
 (0)