Skip to main content

Posts

Showing posts from August, 2014

GRUNT – Cleaning and Minifying JavaScript Files

In this tutorial, we are going to create a NodeJS/Grunt project which has basically used for minifying many JavaScript files into one. The steps are,
Step 1. 
Install NodeJS latest version and refer “http://nodejs.org/download/” link for more information.
Step 2. 
If you are having any existing NodeJS instance then just update by using “npm update –g npm” command. I am having existing NodeJS instance and updated by invoking above command.

Step: 3.
Next, we need a Grunt command line interface (CLI) tools globally. It is a node.js module and needs to install by using a command called “npm install –g grunt-cli”.

Step 4. 
We need another component called grunt-init globally. It is also a node.js module and we can install it globally by invoking a command “npm install –g grunt-init”.

Step 5. 
Next, we need to create a new grunt project. I have created new folder called “Grunt-MinifyDemo” in “D“ directory and this is my project.
Step 6. 
In windows command prompt, Just move to that particular di…