Working with 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 it through a Gruntfile. Pages supports Grunt to make it even easier for developers, this allows us to implement a powerful command line interface for pages. Here are some of the things that we have added using grunt


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 command npm install -g grunt-cli
  • In you downloaded package from themeforest, navigate to grunt/ directory and copy both package.json gruntfile.js to your project root. e.g : getting_started folder
  • Navigate to the root directory of your project, then run npm install.

Once you have succesfully 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 automaically compile the pages Less files on save

Grunt Less

This will compile the pages Less files on excute 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.