CSS/JS pipeline, no asynchronous loading?


Just came across the following and was wondering if someone else faced this before.

I Pipelined all my CSS and JS, which works fine.

Now the problem is that the final ‘pipelined’ version of the CSS/JS is not loaded asynchronous.

I’ve tried changing the following:

{{ assets.js('head',{'loading':'async'}) }}

which results in the following:

which in it's turn does not actually load the script asynchronous as far as i can judge. 

Is there a way to load the final 'pipelined' CSS/JS asynchronous?

There is currently a bug that I just fixed with: https://github.com/getgrav/grav/commit/12ca443cb4ed8b45cbbb2c01f6c7c883bb0c38f6

This will be available in Grav 1.1.0-beta.3 release. However, you can get it working with this workaround:

{{ assets.js('head',{0:'async'}) }}

This will output:

<script src="/grav/assets/7e4dbcc0dd299bc8ab7c8091bab68bd4.js?g-15c57228" type="text/javascript" async="async" ></script>

Which should work fine. Or you can manually merge the fix into your running version of Grav.

Thanks! workaround works fine :slight_smile: