Hi Everyone,
is there a way in AEM to reposition the site bundle that is generated.
right now it always is injected before some of my client lib dependencies
<script src="/etc.clientlibs/bhn/clientlibs/clientlib-site.lc-ebe67a9fbbfc94e400de1cb2bd2c66a9-lc.min.js"></script>
regards
Dev
Solved! Go to Solution.
Views
Replies
Total Likes
Check the Inclusion Source:
Modify the Inclusion:
Hi,
Are you asking if you could place the script in a different part of the document? If so, absolutely yes. You just need to identify which "page" component you are using. From there, you will see a series of "files" being included. For example:
1. My "page" component inherits from core/wcm/components/page/v3/page
.
2. This component has the Page.html
file, which includes head.html
.
3. The head.html
file includes customheaderlibs.html
(which is most likely part of your page component).
If you need to place it elsewhere, you could, for example, overlay the head.html
file and move your scripts where needed.
Hope this helps!
Hi @devendrabhn ,
Try to keep clienlibs js in footer & ensureit is last in the order
Use defer and async attributes on site.js which may also some extent ensure delay
<meta data-sly-call="${clientLib.js @ categories='your.clientlib', loading='defer'}" data-sly-unwrap></meta>
Refernce:- https://github.com/nateyolles/aem-clientlib-async
Apart from that setTimeout or setInterval is another way
const intervalId = setInterval(() => {
console.log("This will be logged every 2 seconds");
}, 2000);
// To stop the interval
clearInterval(intervalId);
Thanks
Check the Inclusion Source:
Modify the Inclusion:
Nice, I will try these