When I am trying to export the theme site in Sitecore 9.3 I get the pre-minified version of css, and pre-minified version of js. How can i export the theme that would contain the normal version of the assets files such as css and js
-
If you are using the creative exchange (live) then you typically start out with the original version of the files. Can you provide more detail about how you setup your theme, what documentation you followed to get started, and what you have tried?– Michael WestJan 24 at 15:25
-
@MichaelWest We do not have any original version of files. Everything has been already minified on the site, and we do not have access to the original version of the files.– Samke11Jan 25 at 9:49
-
Sounds like you are asking to reverse engineer the optimization steps, something that would be out of the scope of Sitecore/SXA.– Michael WestJan 25 at 16:49
-
@MichaelWest Also when I am trying to export the specific page (for example home page) I get everything in minified way? Should that happen or? Shouldnt I get for example index.html of that page, styles and etc.?– Samke11Jan 26 at 19:07
2 Answers
Simple answer is you cannot.
I believe you meant pre-optimized-min not pre-minified.
pre-optimized-min - they are not reversible. Items/files with this name were/should be created outside of Sitecore by FE developers. Read about it here. They are responsible for creating output file using preferred methods. You can think of it as single output file. What SXA/Sitecore does in this case is simply treating it like regular jss/css
[CE] When you export your site with theme you export assets (css/jss), in your case the only one you have is pre-optimized-min.
optimized-min - these are auto-generated by SXA using content of your theme (css/jss), on the same level where assets live. Read this article to find out when it will be used depending on AO options and pre-optimized-min presence.
[CE] When you export your site with theme you export assets (css/jss) but optimized-min is skipped
Have you tried disabling the optimization for the 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 No – to always disable optimization for this site
Here's a link in Sitecore docs