O'Reilly logo

Building Scalable Apps with Redis and Node.js by Joshua Johanan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing Grunt

Our environment is set up; let's do something with it. We need something that will automatically run tasks. This is where Grunt comes in. We can give it a list of tasks that Grunt will execute. The first thing we need to do is create a Gruntfile.js file.

Building a basic Grunt file

Gruntfile.js configures Grunt. It tells Grunt what tasks to carry out, how to run each task, and in what order. We can now create a basic Gruntfile.js file in the root of the project. Add the following code snippet to the file:

module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json') }); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-jshint'); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required