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"​​:​ ​""​,
 

Get Automate with Grunt now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.