Skip to content

Commit e2bfb67

Browse files
committed
Tweaks
1 parent 1d0599a commit e2bfb67

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

frontend/encore/advanced-config.rst

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,29 @@ 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
103+
Next, define the output directories of each build:
104104

105-
.. code-block:: terminal
105+
.. code-block:: yaml
106106
107+
# config/packages/webpack_encore.yaml
107108
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:
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'
114113
115-
.. code-block:: terminal
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') }}
116122
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+
{# 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') }}
123126
124127
Generating a Webpack Configuration Object without using the Command-Line Interface
125128
----------------------------------------------------------------------------------

0 commit comments

Comments
 (0)