Skip to content

Commit 954b398

Browse files
zbragjaviereguiluz
authored andcommitted
Update advanced-config.rst
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.
1 parent f5f0fb6 commit 954b398

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)