@@ -1085,14 +1085,19 @@ both ``app`` and ``checkout``:
1085
1085
{{ importmap(['app', 'checkout']) }}
1086
1086
{% endblock %}
1087
1087
1088
- By passing both ``app `` and ``checkout ``, the ``importmap() `` function will
1089
- output the ``importmap `` and also add a ``<script type="module"> `` tag that
1090
- loads the ``app.js `` file *and * the ``checkout.js `` file. It's important
1091
- to *not * call ``parent() `` in the ``importmap `` block. Each page can only
1092
- have *one * importmap, so ``importmap() `` must be called exactly once.
1093
-
1094
- If, for some reason, you want to execute *only * ``checkout.js ``
1095
- and *not * ``app.js ``, pass only ``checkout `` to ``importmap() ``.
1088
+ The ``importmap() `` function always includes the full import map to ensure all
1089
+ module definitions are available on the page. It also adds a ``<script type="module"> ``
1090
+ tag to load the specific JavaScript entry files you pass to it (in the example
1091
+ above, the ``app.js `` file *and * the ``checkout.js `` file).
1092
+
1093
+ .. warning ::
1094
+
1095
+ Do not call ``parent() `` inside the ``{% block importmap %} `` Twig block. Each
1096
+ page can include only one import map, so ``importmap() `` must be called exactly once.
1097
+
1098
+ If you want to execute *only * ``checkout.js `` (and not ``app.js ``), call
1099
+ ``{{ importmap('checkout') }} ``. In this case, the full import map will still be
1100
+ included in the page, but only the ``checkout.js `` file will actually be loaded.
1096
1101
1097
1102
Using a Content Security Policy (CSP)
1098
1103
-------------------------------------
0 commit comments