8000 Merge branch '5.2' into 5.x · symfony/symfony-docs@d070632 · GitHub
[go: up one dir, main page]

Skip to content

Commit d070632

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Adding details about "defer" and legacy jquery
2 parents 32db72d + 2b41eaf commit d070632

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

frontend/encore/legacy-applications.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,19 @@ The ``global`` variable is a special way of setting things in the ``window``
8787
variable. In a web context, using ``global`` and ``window`` are equivalent,
8888
except that ``window.jQ 8000 uery`` won't work when using ``autoProvidejQuery()``.
8989
In other words, use ``global``.
90+
91+
Additionally, be sure to set the ``script_attributes.defer`` option to ``false``
92+
in your ``webpack_encore.yaml`` file:
93+
94+
.. code-block:: yaml
95+
96+
# config/packages/webpack_encore.yaml
97+
webpack_encore:
98+
# ...
99+
script_attributes:
100+
defer: false
101+
102+
This will make sure there is *not* a ``defer`` attribute on your ``script``
103+
tags. For more information, see `Moving <script> inside <head> and the "defer" Attribute`_
104+
105+
.. _`Moving <script> inside <head> and the "defer" Attribute`: https://symfony.com/blog/moving-script-inside-head-and-the-defer-attribute

0 commit comments

Comments
 (0)
0