From f5ceb9c20a14c178b2f346f9fcdff99fed015a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Tue, 7 Jan 2020 19:35:53 +0100 Subject: [PATCH] Preload styles and javascripts directly via Webpack-Encore. Webpack-encore offers this feature so it is not needed to implment this on our own. --- config/packages/webpack_encore.yaml | 2 +- templates/base.html.twig | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/config/packages/webpack_encore.yaml b/config/packages/webpack_encore.yaml index 9191f4f4..8eb88a34 100644 --- a/config/packages/webpack_encore.yaml +++ b/config/packages/webpack_encore.yaml @@ -8,7 +8,7 @@ webpack_encore: # crossorigin: 'anonymous' # preload all rendered script and link tags automatically via the http2 Link header - # preload: true + preload: true # Throw an exception if the entrypoints.json file is missing or an entry is missing from the data # strict_mode: false diff --git a/templates/base.html.twig b/templates/base.html.twig index b1bdc6cf..b58aa96d 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -45,10 +45,7 @@ {% endif %} - {% for css in encore_entry_css_files('app') %} - - {% endfor %} - + {{ encore_entry_link_tags('app') }} {% endblock %} @@ -119,14 +116,8 @@ {% endblock %} {% block javascripts %} - {% for js in encore_entry_js_files('app') %} - - {% endfor %} - - {% for js in encore_entry_js_files('ru2ftwofactor') %} - - {% endfor %} - + {{ encore_entry_script_tags('app') }} + {{ encore_entry_script_tags('ru2ftwofactor') }} {% endblock %} {% block scripts %}