Getting Started with Grunt: The JavaScript Task Runner

Getting Started with Grunt: The JavaScript Task Runner
eBook: $20.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $55.98    Print cover: $34.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Gain insight on the core concepts of Grunt, Node.js and npm to get started with Grunt.
  • Learn how to install, configure, run, and customize Grunt
  • Example-driven and filled with tips to help you create custom Grunt tasks

Book Details

Language : English
Paperback : 132 pages [ 235mm x 191mm ]
Release Date : February 2014
ISBN : 1783980621
ISBN 13 : 9781783980628
Author(s) : Jaime Pillora
Topics and Technologies : All Books, Web Development, Open Source

Table of Contents

Chapter 1: Introducing Grunt
Chapter 2: Setting Up Grunt
Chapter 3: Using Grunt
Chapter 4: Grunt in Action
Chapter 5: Advanced Grunt
  • Chapter 1: Introducing Grunt
    • What is Grunt?
    • Why use Grunt?
    • Benefits of Grunt
      • Efficiency
      • Consistency
      • Effectiveness
      • Community
      • Flexibility
    • Real-world use cases
      • Static analysis or Linting
      • Transcompilation
        • CoffeeScript
    • Minification
    • Concatenation
    • Deployment
      • FTP
      • SFTP
      • S3
    • Summary
  • Chapter 2: Setting Up Grunt
    • Installation
      • Node.js
      • Modules
      • npm
        • Finding modules
        • Installing modules
      • Grunt
    • Project setup
      • package.json
      • Gruntfile.js
      • Directory structure
    • Configuring tasks
      • Configuring multitasks
      • Configuring options
      • Configuring files
        • Single set of source files
        • Multiple sets of source files
        • Mapping a source directory to destination directory
      • Templates
    • Summary
  • Chapter 3: Using Grunt
    • Creating your own tasks
      • Tasks
        • The task object
        • Task aliasing
      • Multitasks
        • The multitask object
      • Asynchronous tasks
    • Running tasks
      • Command-line
        • Task arguments
        • Runtime options
        • Task help
      • Programmatically
      • Automatically
    • Using third-party tasks
      • Searching for tasks
      • Official versus user tasks
      • Task popularity
      • Task features
      • Task stars
    • Summary
  • Chapter 4: Grunt in Action
    • Creating the build
      • Step 1 – initial directory setup
      • Step 2 – initial configuration
      • Step 3 – organizing our source files
        • Scripts
        • Views
        • Styles
      • Step 4 – optimizing our build files
        • Scripts
        • Styles
        • Views
      • Step 5 – tasks and options
      • Step 6 – improving development flow
      • Step 7 – deploying our application
    • Summary
  • Chapter 5: Advanced Grunt
    • Testing with Grunt
    • Continuous integration with Grunt
    • External tasks
    • Grunt plugins
      • Useful plugins
    • JavaScript resources
    • Development tools
      • Author picks
        • Mac OS X
        • Sublime Text
        • SourceTree
        • Chrome DevTools
      • Community picks
        • WebStorm
        • Yeoman
    • Summary

Jaime Pillora

Jaime Pillora  is a passionate full-stack JavaScript developer, an open source advocate and contributor, and is currently the CTO of Luma Networks, a well-funded networking startup in Sydney, Australia.

Jaime has always been interested in all things computer science, and from a young age, he began to devote his time and effort to learning and perfecting his knowledge in the field. Jaime holds a Bachelor of Computer Science from the University of New South Wales. In all of his work, Jaime strives to reduce technical debt while maintaining maximum efficiency; this is done through software engineering best practices, combined with using the best tools for the given situation. Grunt is one such tool, which is utilized in every frontend project. Jaime's interest in Grunt began early on in his development career and he has since become a renowned expert.

Jaime has been working as a frontend JavaScript developer since 2008, and a backend JavaScript developer utilizing Node.js since 2011. Currently, Jaime leads all software development at Luma Networks, who is implementing software-defined networking on commodity hardware utilizing JavaScript.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


- 1 submitted: last submission 11 Jun 2014

The code files for this book can also be downloaded from 

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Getting Started with Grunt: The JavaScript Task Runner +    Mastering Web Application Development with AngularJS =
50% Off
the second eBook
Price for both: $33.45

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Learn about Grunt and its advantages
  • Understand Node.js and how it relates to Grunt
  • Take an in-depth look at npm, Node.js modules, and the working of Grunt plugins
  • Get familiar with installing Grunt and setting up your first Grunt build environment
  • Gain insight on the methods of configuring Grunt and when each method should be used
  • Effectively execute Grunt through the use of task arguments, task aliasing, multi-task targets, and more
  • Construct your own Grunt tasks, multi-tasks, and asynchronous tasks

In Detail

In recent times, modern web browsers have become the application platform of choice. Grunt, along with its wide range of plugins, provides a simple way of managing the large number of build tasks required to maintain a sophisticated web application.

Getting Started with Grunt: The JavaScript Task Runner provides you with all the information you need to become an effective Grunt power-user. You will quickly learn how to install, configure, and run Grunt. You will go on to understand how to use third-party Grunt and then create your own Grunt tasks that cater to your particular needs.

This book first demonstrates various Grunt use cases before running through the steps of installing, configuring, running, and customizing Grunt. You will learn how to install Node.js, the Node.js package manager (npm), and Grunt. Then, you will understand how to set up and configure a personalized Grunt environment. Next, you will look at the various methods of running and customizing Grunt to utilize its flexibility. Finally, to emphasise what has been learnt, you will see a complete example build of a web application.

Getting Started with Grunt: The JavaScript Task Runner will enable you to create your very own Grunt environments from scratch and fully utilize Grunt’s large feature set to effectively solve your custom requirements.


A step-by-step, practical tutorial to help you transform into a Grunt power-user.

Who this book is for

This book is for JavaScript developers who want to get to grips with GruntJS and use it to build and test their JavaScript applications. The only requirement for this book is a basic understanding of objects and functions in JavaScript.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software