/** * Created by Answer1215 on 11/15/2014. */ module.exports = function(grunt){ grunt.initConfig({ files: ["'js'", "html"], compile: "<%- files %>" //encoding charater }); //compile: "<%= files %>" //no encoding grunt.registerTask("default", function(){ grunt.log.writeln(grunt.config.get("compile")); //js, html grunt.log.writeln(grunt.template.process("<%= files %>")); //js.html grunt.log.writeln(grunt.template.today('yyyy-mm-dd')); //2014-11-15 }); }
Template strings can be processed manually using the provided template functions. In addition, the config.get method (used by many tasks) automatically expands <% %> style template strings specified as config data inside the Gruntfile.
Read More: http://gruntjs.com/api/grunt.template
转载于:https://www.cnblogs.com/Answer1215/p/4100784.html
最后
以上就是幸福大碗最近收集整理的关于[Grunt] grunt.template的全部内容,更多相关[Grunt]内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复