Have you ever thought that how much time you are spending to build AEM clientlibs and how much time you are wasting on just to find out what js or CSS file to include by asking front end developer, something like this hey Raj tell me, what are all the files should I include for this particular component or template? even though if you are a professional developer sometimes you will definitely face a problem because you are not a front-end developer, you don’t know what the front end developer is done.
Have you ever thought that if front end people creates a clientlib for you instead of providing CSS and js files? sounds great, haha, the problem here is the front-end people cannot create clientlibs, because they are not AEM developers?
To solve above problems and also to streamline the integration process, I have created a custom Grunt plugin called Grunt AEM clientlibs generator and installer plugin, which generates clientlibs and automatically deploy’s it into your local AEM instance in a minute
The pre-requisites for this is you must install node.js on your local machine and also the AEM author instance should up and running
if you are not a front-end developer then refer this for downloading and installing node.js on your local machine, once node.js is installed then create a folder called “clientlibs-generation” in the “C:\\” drive
Open the “clientlibs-generation” folder in the command prompt and run the below commands
npm install grunt
The above command install all the grunt related node modules into the “clientlibs-generation” folder
Now, run the below command to install our custom clientlibs generator grunt plugin
After running below command, using the packageName option which is provided in the Gruntfile.js the plugin will create one zip folder and it will be deployed into your local AEM instance and you can copy and paste another folder into your eclipse to check-in into your version control if required
Now, go and open AEM instance package manager, you should see something like below, by default it is not installed, if you want to install by default then you must change force and install option to “true” in the Gruntfile.js
How to run sample project?
Download below code then open the command prompt of extracted folder and execute step 3 & 4 and finally run below command
A technology enthusiast and a professional blogger from India. Through out my IT career, I have had the pleasure of working on various new technologies and built products like www.ziprides.com and some other products. Unfortunately, my attempts have not given me the desired results and as a result, I have finally decided to build a professional blog where I would like to share all my learnings and hoping to learn from other enthusiasts around the world.