I created a custom rendering in SXA 1.4, I created a new JavaScript file for that component and I'm trying to added it to to be rendered in the public site.

How can I do that for the entire site or for a single page where the components is used?

2 Answers 2


This is part of the standard setup for SXA themes. Sitecore outlines theme creation here. Simply add the script to the theme found in the media library.

As for page specific, this question on SSE may give you the solution you need.

  • OK... so once I add/delete a script item under my theme's scripts folder, the optimized-min.js gets deleted and regenerated to include the latest updates. Cool. Thanks
    – TamerM
    Commented Mar 25, 2018 at 15:06
  • 1
    That is correct. If you add aodisabled=1 in your script, you can see the unbundled version; disabling the bundle feature can be done globally or on a site level as well. Commented Mar 25, 2018 at 15:15

The SXA allow you to add your custom JS based on you theme.

You can create Multiple themes and different logics and different JS and can use them based on you needs. This allows to have more command over Multiples Sites based solution.

enter image description here

There is also a way for adding a page specific JS.

Thanks to @MichaelWest


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.