gruntfile-editor icon indicating copy to clipboard operation
gruntfile-editor copied to clipboard

#registerTask(): add function to array

Open eddiemonge opened this issue 9 years ago • 0 comments

registered task is array and task is function.

  • Convert array to a function call
  • Add grunt.task.run(existingTasks) to function call
  • Append function task to function call

See https://github.com/bezoerb/gruntfile-api/tree/master#register-task for reference

Before:

grunt.registerTask('build', [
  'task1',
  'task2',
  'task3'
]);

After:

grunt.registerTask('build', function(target) {
  grunt.task.run([
    'task1',
    'task2',
    'task3'
  ]);
  // new custom function task
});

eddiemonge avatar Jul 29 '14 06:07 eddiemonge