Configuring tasks
Grunt configuration can be thought of as single JavaScript object, though, instead of assigning values, we'll use functions provided by Grunt to get and set properties.
We briefly touched on Grunt configuration in Chapter 1, Introducing Grunt, displaying simple uses of the grunt.initConfig
, grunt.config.get
and grunt.config.set
functions. The grunt.initConfig
function (which as mentioned earlier, is aliased from grunt.config.init
) accepts an object, which is then used as the starting point for our configuration, whereas the grunt.config.get
and grunt.config.set
functions are used to get and set individual properties. We can also use the shorter grunt.config
function, which works like jQuery getters and setters. When called with ...
Get Getting Started with Grunt: The JavaScript Task Runner 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.