Expand my Community achievements bar.

SOLVED

Minifying a clientlib of embedded clientlibs fails

Avatar

Level 4

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

1 Accepted Solution

Avatar

Correct answer by
Level 4

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

View solution in original post

1 Reply

Avatar

Correct answer by
Level 4

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