Grunt
In one word: automation. The less work you have to do when performing repetitive tasks like minification, compilation, unit testing, linting, etc, the easier your job becomes. After you've configured
Installing Grunt
To install grunt first you must have NodeJs installed, NodeJS will have npm (node packaged modules) Run the following commands
Install
grunt-cli
globally by running the following commandnpm install -g grunt-cli
In you downloaded package from themeforest, navigate to
grunt/
directory and copy bothpackage.json
gruntfile.js
to your project root. e.g :getting_started
folderNavigate to the root directory of your project, then run
npm install
.
Once you have successfully setup now you can use pages Grunt CLI commands to automate your task
Commands
Grunt Build
This will automatically minify your assets resources like css and js into a folder called dist
Grunt Watch
This will automatically compile the pages Less files on save
Grunt Less
This will compile the pages Less files on execute once
Your are free to customize the Grunt task to your need by editing the gruntfile.js in the root directory of getting_started
Troubleshooting
Should you encounter problems with installing dependencies or running Grunt commands, first delete the /node_modules/
directory generated by npm. Then, rerun npm install
.
Last updated