Hi there,
It seems that when adding a JS file inline trough param of Grav assets manager, the order is not respected. Inlined assets are always rendered on the last position.
e.g. this:
{% block javascripts %}
{% do assets.addJs('theme://js/manifest.js, {'priority':100, 'loading':'inline'}) %}
{% do assets.addJs('theme://js/main.js', {'priority':10}) %}
{% endblock %}
{{ assets.js }}
render into:
<script src="/user/themes/mytheme/js/main.js" type="text/javascript" defer=""></script>
<script>inlined content of manifest.js file</script>
It's a problem that js rendering order doesn't respect the given order in Grav assets manager params as it can break the js code.
Cheers
As discussed in slack, this is really a significant change, and i've marked it as an enhancement because it will require a fair bit of work that has backwards compatibility implications. I'll look at it when i get a chance.
Thank you 馃槃
Most helpful comment
As discussed in slack, this is really a significant change, and i've marked it as an enhancement because it will require a fair bit of work that has backwards compatibility implications. I'll look at it when i get a chance.