Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Getting Started with Grunt: The JavaScript Task Runner
  • Table Of Contents Toc
  • Feedback & Rating feedback
Getting Started with Grunt: The JavaScript Task Runner

Getting Started with Grunt: The JavaScript Task Runner

By : Jaime Pillora, Bocoup LLC
4.4 (10)
close
close
Getting Started with Grunt: The JavaScript Task Runner

Getting Started with Grunt: The JavaScript Task Runner

4.4 (10)
By: Jaime Pillora, Bocoup LLC

Overview of this book

Table of Contents (12 chapters)
close
close

Running tasks


Up until this point, we have learnt how to configure and create tasks. Now it is time to run them!

Command-line

Some Node.js command-line tools, such as express, may also be used as a module, whereas Grunt may only be used via the command-line. Once we've globally installed the grunt-cli module, our system will have access to the grunt executable.

To run our newly loaded or created tasks, we need to provide Grunt with a list of task names as space-separated command-line arguments. This will result in Grunt executing each specified task in sequence; which means we can easily dictate the order of task execution. We could run foo then bar with:

$ grunt foo bar

Or, we run bar then foo with:

$ grunt bar foo

There is a special case, however, when we execute grunt on its own. Grunt interprets this as grunt default and subsequently will attempt to run the default task. Therefore, by registering a default task, we can make it easy to run our most common task. Similar to our previous example...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete