It's possible add Uglifyjs2 to AEM? | Community
Skip to main content
August 18, 2016
Solved

It's possible add Uglifyjs2 to AEM?

  • August 18, 2016
  • 4 replies
  • 1166 views

Hi everyone, I'm trying to reduce some js files, and I want to use a more modern library than YUI compressor, like uglifyjs2, so my question is, it's possible this change? or just add uglifyjs? 

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by varun_varada

We ran into a similar issue, and swapping out the built-in YUI Compressor in the Granite HTML Library Manager seemed intractable.

We use the UglifyJS2 tool at build time to minify the JS files into the source directories, but with a .min.js extension. The js.txt files all reference the .min.js files, and all the code is concatenated at run time with the HTML Library Manager's categories feature.

4 replies

kautuk_sahni
Community Manager
Community Manager
August 19, 2016

Hi 

I have not seen this Use-case with AEM as of now.

I hope someone in community could help you.

 

Just Fyi...

In AEM we have JS/Css minification service,

Link:- http://blogs.adobe.com/experiencedelivers/experience-management/clientlibs-explained-example (Search for Step 6: Minify and Gzip )

//To deliver a better performance you can enable Minify and Gzip for the Adobe Granite HTML Library Manager (previously also called Day CQ HTML Library Manager), in the Felix Configuration console (http://server/system/console/configMgr). These settings are recommended for production installations.

 

Link:- http://aem.matelli.org/client-library-configuration-minify-and-debug/

 

Thnaks and Regards

Kautuk Sahni

Kautuk Sahni
kautuk_sahni
Community Manager
Community Manager
August 19, 2016

Hi 

In addition to the yuicompressor-maven-plugin, the Google Closure compiler, JSMin, Packer, and UglifyJS are examples of build-time minifiers. 

Link:-https://github.com/tqh/uglifyjs-maven-plugin

~kautuk

Kautuk Sahni
varun_varadaAccepted solution
August 19, 2016

We ran into a similar issue, and swapping out the built-in YUI Compressor in the Granite HTML Library Manager seemed intractable.

We use the UglifyJS2 tool at build time to minify the JS files into the source directories, but with a .min.js extension. The js.txt files all reference the .min.js files, and all the code is concatenated at run time with the HTML Library Manager's categories feature.

August 19, 2016

Varun Varada wrote...

We ran into a similar issue, and swapping out the built-in YUI Compressor in the Granite HTML Library Manager seemed intractable.

We use the UglifyJS2 tool at build time to minify the JS files into the source directories, but with a .min.js extension. The js.txt files all reference the .min.js files, and all the code is concatenated at run time with the HTML Library Manager's categories feature.

 

Thanks, I will try it, but when the file is concatenated that will just paste all files one under another?, I think is not the best solution, but, also maybe can be the only solution