Minifying a clientlib of embedded clientlibs fails

Tyler_Maynard

27-09-2016

I have a clientlib that I call an 'aggregator' clientlib. It's sole purpose is to collect all of our front end component cllientlibs and send them in 1 request.

For some reason, the minification that works with other clientlibs doesn't work on these types of clientlibs where there are no real javascript files. I've even gone in and created a javascript file to see if that would fix the issue by at least having a single javascript file in the clietnlib, but it does not.

Has anyone had this problem? I am suprised this isn't working because it is the way that the newer AEM Archetypes builds out front-end clientlbs.

Here is an example of an 'aggregator' clientlib:

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="cq:ClientLibraryFolder" categories="[mysite.all]" embed="[ mysite.site, mysite.component.heros, mysite.component.anothercomponent, mysite.components.thirdcomponent ]" />

So in this case the following clientlib loads fine:

http://localhost:4502/etc/clientlibs/mysite/mysite_all.js

But this doesn't:

http://localhost:4502/etc/clientlibs/mysite/mysite_all.min.js

Thanks

-Tyler

Accepted Solutions (1)

Accepted Solutions (1)

Tyler_Maynard

27-09-2016

I found the problem and am posting it here in case anyone else comes across this issue.

If you are trying to minify a clientlib of embedded clientlibs and one of the embedded clientlibs fails to resolve, then it will not minify and throw a 404 when calling on that minified clientlib.

A tool I used to help was the clientlibs validation which will show unresolvable clientlibs in red:

http://localhost:4502/libs/granite/ui/content/dumplibs.validate.html

-Tyler

Answers (0)