3

We use Unicorn in our project, and we are saving the pre-optimized-min.yml files in source control. Here is the exclude predicate we have for this file:

<exclude childrenOfPath="/sitecore/media library/Themes/<Name>/<Name>/styles">
     <except name="pre-optimized-min" />
</exclude>

We use a standard SXA CLI Setup.

enter image description here

The problem is that after minification, SOMETIMES, the yml file is saved with a GUID at the end of the name:

enter image description here

This is causing issues in our CI/CD pipeline as the file is not recognized and our styles are not picked up correctly.

Any ideas on this could be happening?

0

2 Answers 2

2

pre-optimized-min items are generated automatically. Each time with new id.

When you save pre-optimized-min.yml in your source control, next time someone checks out from source control and their Sitecore generates new pre-optimized-min, it wants to serialize that new item, but it checks that there is already a file like that on the drive, so it adds guid to the file name.

Normally, when SXA deletes old 'pre-optimized-min` item, it deletes serialized item as well. But because you keep the old one in source control, there are situations that old one is still there from source control, a new one is created with guid in filename.

1

This is likely a consequence of multiple items with the same name added into the media library. Unicorn detects this and writes a new file (presumably with a new GUID) to disk but then has to append the GUID to the filename to avoid conflicts.

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.