How to use the registerMultiTask function from grunt

Find comprehensive JavaScript grunt.registerMultiTask code examples handpicked from public code repositorys.

16
17
18
19
20
21
22
23
24
var _ = grunt.util._;
var defaultEnv = {};

function init(grunt)
{
    grunt.registerMultiTask('devcode', 'Remove code blocks based on environment configuration', function()
    {
        var context = _.extend({},defaultEnv,process.env), files;
        context.NODE_ENV = context.NODE_ENV || 'development';
fork icon7
star icon20
watch icon2

24
25
26
27
28
29
30
31
32
33



module.exports = function (grunt) {

  grunt.registerMultiTask('reverse', 'Deconstruct your HTML into components.', function () {

    var cb = this.async();
    // Merge task-specific and/or target-specific options with these defaults.
    var options = this.options({});
fork icon2
star icon4
watch icon7

146
147
148
149
150
151
152
153
154
155

```javascript
// node_tasks/custom-task.js
'use strict';
module.exports = function(grunt) {
    grunt.registerMultiTask('custom-task', 'Make Grunt do something custom', function() {
        // ...
    })
}
```
fork icon1
star icon3
watch icon3

+ 3 other calls in file

8
9
10
11
12
13
14
15
16
17
let basename = require('path').basename
let extname  = require('path').extname
let join = require('path').join

module.exports = function(grunt){
    grunt.registerMultiTask('fontmin', 'Minimize fonts', taskFontmin)
}


// grunt task function
fork icon1
star icon2
watch icon2