adobe / aem-project-archetype

Maven template to create best-practice websites on AEM.
https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetype/overview.html
Apache License 2.0
547 stars 421 forks source link

Double minification of clientlibs generated by ui.frontend module #245

Closed godanny86 closed 4 years ago

godanny86 commented 5 years ago

Expected Behaviour

The CSS and JS generated by the ui.frontend module is minified before it gets pushed into AEM. I would expect that CSS/JS generated by the ui.frontend module will be ignored by AEM's internal minification engine. I do not want to turn off AEM's minification completely as I also want clientlibraries in AEM (core components, aem grid) to be minified in production.

Actual Behaviour

CSS and JS generated by the ui.frontend module ends up getting double minified because it gets surfaced on the page as an embedded clientlibrary in the clientlib.base.

Steps to Reproduce

Vanilla config with archetype 21.

Potential Solution

A potential solution would be to include any client libraries generated by the ui.frontend module on the page by adding them separately and not as an embed via clientlib.base. This could be done by updating customheaderlibs.html or an even cleaner approach may be to add the generated ui.frontend categories as part of the template page policy:

image

Using the template page policy means less reliance on updating the HTL scripts, see the following PR for an example: https://github.com/adobe/aem-guides-wknd/pull/23/files

bpauli commented 4 years ago

fixed in https://github.com/adobe/aem-project-archetype/pull/250