O'Reilly logo

Automate with Grunt by Brian P. Hogan

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

Multitasks and Files

One of the most common uses for multitasks is in creating distribution packages for JavaScript libraries. To demonstrate, let’s take the AngularJS library and create our own custom versions. We’ll create one version that includes just AngularJS and the angular-resource library, and then a second version that also includes the jQuery library.

First, create a new folder called angular and then create a new package.json file in that folder using npm init:

 
$ ​mkdir angular
 
$ ​cd angular
 
$ ​npm init

For the settings, use the defaults. Or you could create your own package.json file that looks like this:

 
{
 
"name": ​"AngularCustom"​,
 
"version": ​"0.0.1"​,
 
"description": ​""​,
 
"devDependencies": {
 
"grunt": ​ ...

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