How to install minified js files through maven in AEM CRXDE | Community
Skip to main content
vasimakram
Level 4
December 9, 2015
Solved

How to install minified js files through maven in AEM CRXDE

How to install minified js files through maven in AEM CRXDE instead of going through Day CQ HTML Library Manager configuration ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Peter_Puzanovs
Peter_PuzanovsAccepted solution
New Participant
December 9, 2015

Hey Vasim,

You can switch and use alternative js minification tools.

gulp[1] or grunt[2] can be used to minify your js as part of maven build[3,4,5], this would give you and your devs more flexibility and have smaller size minified js files.

[1] http://gulpjs.com/

[2] http://gruntjs.com/

[3] https://github.com/allegro/grunt-maven-plugin

[4] https://github.com/eirslett/frontend-maven-plugin

[5] http://www.slideshare.net/ZoranNikolovski/making-maven-and-grunt-play-nice

Thanks,

Peter

6 replies

kautuk_sahni
Employee
December 11, 2015

HI

Just to add what Peter has said, A Grunt plugin to read AEM clientlibs js.txt and css.txt files to JSON for use with other grunt plugins. e.g. concat, less compilation, jslint, jasmine unit tests.

Reference links :-

Link:- https://www.npmjs.com/package/grunt-aem-clientlibs

Link:- http://adapt.to/2015/en/schedule/integrate-modern-frond-end-development-with-aem-sling.html (Presentation in the end)

Link:- http://www.slideshare.net/ZoranNikolovski/making-maven-and-grunt-play-nice

I hope this would help you.

Thanks and Regards

Kautuk Sahni

Translate
Kautuk Sahni
Peter_Puzanovs
Peter_PuzanovsAccepted solution
New Participant
December 9, 2015

Hey Vasim,

You can switch and use alternative js minification tools.

gulp[1] or grunt[2] can be used to minify your js as part of maven build[3,4,5], this would give you and your devs more flexibility and have smaller size minified js files.

[1] http://gulpjs.com/

[2] http://gruntjs.com/

[3] https://github.com/allegro/grunt-maven-plugin

[4] https://github.com/eirslett/frontend-maven-plugin

[5] http://www.slideshare.net/ZoranNikolovski/making-maven-and-grunt-play-nice

Thanks,

Peter

Translate
vasimakram
Level 4
December 9, 2015

I am using AEM 5.6.1. It just removing spaces(as shown in image 1.png). I want something like in image (2.png).

Translate
edubey
Level 10
December 9, 2015

Two questions:

1. Which AEM Version you are referring?

2. Can you tell  what level of minification currently you have and wht more you are expecting?

Translate
vasimakram
Level 4
December 9, 2015

I have 100 js files. I tried by turning minify to ON Day CQ HTML Library Manager configuration doing basic level minification. I want more minification. Is there any way?

Translate
edubey
Level 10
December 9, 2015

Hi,

I presume that you are using Eclipse,

Use any external tool to convert to minify your existing js, once done copy and paste the content of js file under /etc/design/js-file-path and take the build

Translate