@@ -96,7 +96,7 @@ This is where Reprise pays off: once ``entrypoints.json`` exists, ``RepriseBundl
9696``<script> `` and ``<link> `` tags for an entry directly in Twig, the same experience `WebpackEncoreBundle `_ gives you
9797with ``encore_entry_script_tags `` and ``encore_entry_link_tags ``.
9898
99- Four Twig functions come with it:
99+ Five Twig functions come with it:
100100
101101.. code-block :: twig
102102
@@ -124,6 +124,16 @@ Four Twig functions come with it:
124124 ``reprise_entry_js_files('app') `` and ``reprise_entry_css_files('app') `` are the same lookup, minus the HTML: they
125125return the raw URL lists, for the rare case where you need the paths rather than the tags.
126126
127+ ``reprise_entry_exists('checkout') `` returns ``true `` when the named entry is present in ``entrypoints.json `` and
128+ ``false `` otherwise. Use it to guard a page-specific or optional entry so rendering its tags doesn't error in strict
129+ mode:
130+
131+ .. code-block :: twig
132+
133+ {% if reprise_entry_exists('checkout') %}
134+ {{ reprise_entry_script_tags('checkout') }}
135+ {% endif %}
136+
127137 If you're migrating from Webpack Encore, it's a tag-for-tag swap (Reprise is Encore's heritage, so the template
128138shape hasn't changed):
129139
@@ -145,6 +155,9 @@ shape hasn't changed):
145155 * - ``encore_entry_js_files('app') ``
146156 - ``reprise_entry_js_files('app') ``
147157 - JS URL list
158+ * - ``encore_entry_exists('app') ``
159+ - ``reprise_entry_exists('app') ``
160+ - ``true ``/``false ``
148161
149162``reprise_entry_script_tags `` and ``reprise_entry_link_tags `` take a fourth ``attributes `` argument, merged over the
150163global ``script_attributes ``/``link_attributes `` (per-call wins, ``false `` drops the attribute). It mirrors Encore's
0 commit comments