Preload styles and javascripts directly via Webpack-Encore.

Webpack-encore offers this feature so it is not needed to implment this on our own.
This commit is contained in:
Jan Böhmer 2020-01-07 19:35:53 +01:00
parent f0fb4a3deb
commit f5ceb9c20a
2 changed files with 4 additions and 13 deletions

View file

@ -45,10 +45,7 @@
<link rel="stylesheet" href="{{ preload(asset('build/themes/bootstrap.css'), {as: 'style'}) }}">
{% endif %}
{% for css in encore_entry_css_files('app') %}
<link rel="stylesheet" href="{{ preload(asset(css), {as: 'style'}) }}">
{% endfor %}
{{ encore_entry_link_tags('app') }}
{% endblock %}
</head>
<body data-base-url="{{ url('homepage', {'_locale': app.request.locale}) }}">
@ -119,14 +116,8 @@
{% endblock %}
{% block javascripts %}
{% for js in encore_entry_js_files('app') %}
<script src="{{ preload(asset(js), {as: 'script'}) }}"></script>
{% endfor %}
{% for js in encore_entry_js_files('ru2ftwofactor') %}
<script src="{{ preload(asset(js), {as: 'script'}) }}"></script>
{% endfor %}
{{ encore_entry_script_tags('app') }}
{{ encore_entry_script_tags('ru2ftwofactor') }}
{% endblock %}
{% block scripts %}