Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write helpers in new Grunt 0.4

In an older grund versions I execute helpers like the following:

module.exports = function (grunt) {
   grunt.registerMultiTask('taskname', "Grunt task example", function () {
      var result = grunt.helper('helpername', options, data);

      ...
   });

   grunt.registerHelper('helpername', function (options, data) {
      return data;
   });
};

How should I execute helpers in new Grunt 0.4 version?

like image 878
Erik Avatar asked Nov 13 '22 10:11

Erik


1 Answers

From the Upgrading from 0.3 to 0.4 page

Helpers

Grunt's helper system has been removed in favor of node require. For a concise example on how to share functionality between Grunt plugins, please see grunt-lib-legacyhelpers. Plugin authors are encouraged to upgrade their plugins.

like image 95
Charles Avatar answered Nov 15 '22 05:11

Charles