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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With