I'm working on this document to remove blocking js:
However with CQ5 we include js via:
<cq:includeClientLib js="headlibs"/>
How can I modify script tag like:
<script async src="my.js">
So I can remove blocking JS.
I'm working on this document to remove blocking js:
However with CQ5 we include js via:
<cq:includeClientLib js="headlibs"/>
How can I modify script tag like:
<script async src="my.js">
So I can remove blocking JS.
The cq:includeClientLib does not have any options to do this. You can try using the com.day.cq.widget.HtmlLibraryManager interface to get the path of JS file, the tag is a is a convenience wrapper of this interface.
The method
getIncludePath()
also takes an additional parameter minified (boolean) to give path to the minified file.