Expand my Community achievements bar.

SOLVED

How to install minified js files through maven in AEM CRXDE

Avatar

Level 4

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

6 Replies

Avatar

Level 10

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

Avatar

Level 4

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?

Avatar

Level 10

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?

Avatar

Level 4

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).

Avatar

Correct answer by
Community Advisor

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

Avatar

Administrator

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



Kautuk Sahni