在较旧的grund版本中,我执行如下的帮助:
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; }); };
我应该如何在新的Grunt 0.4版本中执行帮助?
解决方法
从
Upgrading from 0.3 to 0.4页面
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 07001. Plugin authors are encouraged to upgrade their plugins.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。