Page tree
Skip to end of metadata
Go to start of metadata

Don't know how to use Grunt? Find out here!

Step-by-step guide

Install grunt

$ sudo npm install -g grunt-cli

Initialise package.json

$ npm init

Install grunt task runner

$ npm install grunt --save-dev

Create a Gruntfile.js containing this

 

Gruntfile.js
module.exports = function(grunt) {
    grunt.initConfig({


    });
}

 

Install load-grunt-tasks

$ npm install load-grunt-tasks --save-dev

Add the config to Gruntfile.js

 

load-grunt-tasks
module.exports = function(grunt) {
    require('load-grunt-tasks')(grunt);
    grunt.initConfig({
    ...

 

You are now good to go, adding plugins for the tasks you might need! Here are two to start you off:

  1. grunt-contrib-sass
  2. grunt-contrib-uglify