Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

How to install minified js files through maven in AEM CRXDE

vasimakram
Level 4
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
Peter_Puzanovs
Correct answer by
Community Advisor
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
edubey
Level 10
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

vasimakram
Level 4
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?

edubey
Level 10
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?

vasimakram
Level 4
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).

Peter_Puzanovs
Correct answer by
Community Advisor
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

kautuk_sahni
Community Manager
Community Manager

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