Expand my Community achievements bar.

SOLVED

Add Custom Java Script and swiper library in EDS

Avatar

Level 2

I am Trying to create module with swiper in EDS. HTML part i have done. But adding Custom Java script for the module and Swiper library is triggering error. Can anyone guide me how to add swiper and custom JS for my module in Edge Delivery service. 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @mohamedvalith In EDS you can load any script, but the loading of the script will impact your Lighthouse if it is not loaded properly.

 

So, the ideal way to load the script will be withing the section i.e. loadDelayed, so that there is no blocking time for the LCP data.

 

Please refer to the github boilerplate https://github.com/adobe/aem-boilerplate/blob/main/scripts/scripts.js 

Thanks

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @mohamedvalith In EDS you can load any script, but the loading of the script will impact your Lighthouse if it is not loaded properly.

 

So, the ideal way to load the script will be withing the section i.e. loadDelayed, so that there is no blocking time for the LCP data.

 

Please refer to the github boilerplate https://github.com/adobe/aem-boilerplate/blob/main/scripts/scripts.js 

Thanks

Avatar

Level 2

Thank you ShaileshBassi. It is very helpful and your suggestion working fine.