Expand my Community achievements bar.

SOLVED

It's possible add Uglifyjs2 to AEM?

Avatar

Level 1

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!

1 Accepted Solution

Avatar

Correct answer by
Level 1

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.

View solution in original post

4 Replies

Avatar

Administrator

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

Avatar

Administrator

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

Avatar

Correct answer by
Level 1

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.

Avatar

Level 1

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