Skip to content

Commit 39792cd

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: [AssetMapper] Adding note about importmap block
2 parents 8b30d20 + 92554b9 commit 39792cd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

frontend/asset_mapper.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,11 @@ both ``app`` and ``checkout``:
10001000
.. code-block:: twig
10011001
10021002
{# templates/products/checkout.html.twig #}
1003-
{% block javascripts %}
1003+
{#
1004+
Override an "importmap" block in base.html.twig.
1005+
If you don't have this, add it around the {{ importmap('app') }} call.
1006+
#}
1007+
{% block importmap %}
10041008
{# do NOT call parent() #}
10051009
10061010
{{ importmap('app', 'checkout') }}
@@ -1009,7 +1013,7 @@ both ``app`` and ``checkout``:
10091013
By passing both ``app`` and ``checkout``, the ``importmap()`` function will
10101014
output the ``importmap`` and also add a ``<script type="module">`` tag that
10111015
loads the ``app.js`` file *and* the ``checkout.js`` file. It's important
1012-
to *not* call ``parent()`` in the ``javascripts`` block. Each page can only
1016+
to *not* call ``parent()`` in the ``importmap`` block. Each page can only
10131017
have *one* importmap, so ``importmap()`` must be called exactly once.
10141018

10151019
If, for some reason, you want to execute *only* ``checkout.js``

0 commit comments

Comments
 (0)