-
Notifications
You must be signed in to change notification settings - Fork 1
How to install and run Grunt for Fixometer app
-
Firstly, install Node.js. By default node.js will install npm.
-
To learn about npm.
-
To learn about Grunt
In command line interface:
-
Now install and update the npm to latest version by using following command.
1. npm install
2. npm install npm@latest -g
3. npm -v //to check the version of npm -
Following are the commands to install and save grunt through npm.
1. npm install -g grunt-cli
2. npm install -g grunt
3. npm install grunt --save-dev
4. npm grunt-contrib-jshint --save-dev -
All these files are installed globally, so any project can use them.
example- C:/Program Files/node.js > npm install -
Now change the path to your project path.
example- C:/vhosts/fixometer.test > npm install
In Gitbash Terminal:
-
After all the above steps, close and open the gitbash terminal(if opened already) so that it would pickup all the updated files.
-
To check whether grunt is working or not in our project path, follow the command below.
1. $grunt //if it shows as Running "watch" task, it means its installed and working. -
So whenever we make changes to base.js file in fixometer project, save the file in editor and run the following commands in gitbash terminal.
1. c:/vhosts/fixometer.test - $ grunt concat:dist && grunt uglify -
grunt concat:dist - This concat command is used to concat all the .js files into single .js file.
-
grunt uglify - This uglify command is used to compress the .js file.
-
Thus the above two commands are used to combine and compress the .js files in order to decrease the download time of the project.