You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #102 Adding support for custom attributes on rendered script and link tags (weaverryan)
This PR was squashed before being merged into the main branch.
Discussion
----------
Adding support for custom attributes on rendered script and link tags
Fixes#10 - thanks to @dsech for the idea of relying on named Twig arguments (otherwise the new Twig attributes argument is the 4th argument... and rather inconvenient).
This can be configured in *3* different ways:
## 1) Globally
```
webpack_encore:
# ...
script_attributes:
defer: true
```
2) when when using the Twig functions:
```twig
{{ encore_entry_script_tags('my_entry', attributes={
defer: true
}) }}
```
3) Via a new `RenderAssetTagEvent`
As stated at the bottom of #10 - #10 (comment) - there may be some additional options that would also be nice, but this probably covers the biggest use-case.
NOTE: This also drops support for EOL Symfony versions.
Cheers!
Commits
-------
b26cc85 Adding support for custom attributes on rendered script and link tags
if ($entrypointLookupCollectioninstanceof EntrypointLookupInterface) {
35
41
@trigger_error(sprintf('The "$entrypointLookupCollection" argument in method "%s()" must be an instance of EntrypointLookupCollection.', __METHOD__), E_USER_DEPRECATED);
0 commit comments