Automatically Synchronising Themes for SXA Sites

Is "import theme" the only way to update/upload themes in SXA?

Importing themes is easy. However, it would be easier, if the theme could be uploaded automatically whenever CSS/JavaScript is changed. And it would be even more productive / efficient for front-end bug fixing/debugging, as front-end developers wouldn't have to log in to Sitecore and upload files manually.

Well we have some great news folks, out-of-the-box SXA already has this feature! It's not been mentioned in official documentation, but it's there.


How do you enable the auto-synchroniser?

  1. Open the /Website/App_Config/Include/Feature folder and remove .disabled from the file named z.SPE.Sync.Enabler.Gulp.config.disabled.
  2. Update the config file for Gulp tasks, e.g. the ThemeRoot/gulp/config.js file as shown below.

  3. Run gulp.

After that, you will notice that all compiled CSS/JavaScript is automatically uploaded into Sitecore.

Tip: Disable optimizer, otherwise you will have to manually delete optimized.min files.

— Zhen Yuan

Want more?

View the Blog

Switch has been globally recognised winning the Ultimate Sitecore Experience Award for the Most Sophisticated Implementation in 2020.
Read more Experience Awards 2020 Winner

Switch acknowledges the Traditional Custodians of the lands where we live, learn, and work and we pay our respects to their Elders past and present.

Sydney
Level 6
9 Hunter Street
Sydney NSW 2000
Phone +61 02 8188 5959
Melbourne
Level 2
696 Bourke St
Melbourne VIC 3000
Phone +61 03 8566 8819
New Zealand
11-19 Customs Street West
Auckland 1010

Phone +64 9 887 4657
Singapore
8 Cross Street
Singapore, 048424

Phone +65 3106 4217
ABN 15 120 572 750   ·   © 2021 Switch

Subscribe Now

Sign up to our newsletter to gain access to more articles like this one

No thanks