以下是来自http://gruntjs.com/getting-started的样例gruntjs代码:
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'src/<%= pkg.name %>.js',
dest: 'build/<%= pkg.name %>.min.js'
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task(s).
grunt.registerTask('default', ['uglify']);
};
接下来提到:
因为<% %>模板字符串可以引用任何配置属性,所以可以通过这种方式指定配置数据,如文件路径和文件列表,以减少重复。
我的问题:
<%= %>
是什么意思?它是gruntjs语法还是在其他地方通用?我在哪里可以找到其定义?您寻找解释奇怪符号的一般方法是什么?如果我在Google/StackOverflow中搜索这些字符串(“<%=”、“<%”),无论是否带引号,基本上都没有合理的结果。