I have an existing SXA project with a custom theme, in my local machine.
I have made changes in the gallery.js file.

Path: D:\Projects\External\MyProject\theme\-\media\Themes\MyProject\Shared\Shared Theme\scripts\components\gallery.js


enter image description here

Then I executed these commands - sxa build Js & sxa upload Js.

enter image description here

I'm expecting the changes to go into the CMS item - /sitecore/media library/Themes/MyProject/Shared/Shared Theme/Scripts/pre-optimized-min, but unfortunately they didn't.

enter image description here

What is the correct way to push script/css changes into the CMS item.

Using Sitecore 10.1.3

1 Answer 1


You can disable minification and debugging to see if your JS updates reflect correctly.

To change the optimization settings for a specific site. In the Content Editor, navigate to sitecore/content/<Tenant>/<Site>/Presentation/Page Designs.

In the Asset Optimization section, in the Styles Optimizing Enabled and Scripts Optimizing Enabled fields, to override styles and scripts optimization settings, select:

  • Default – to inherit global settings

  • Yes – to always enable optimization for this site.

  • No – to always disable optimization for this site.

enter image description here

Select Script Optimisation Enabled to No and try again to validate it.

Hope it helps!

  • I set Scripts Optimising Enabled to No. But sxa build Js still says Js Minification Done. Executing sxa upload Js after that has no change when pre-optimized.min.js loads on page.
    – sukesh
    Commented Dec 26, 2023 at 2:44

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.