4
在配置我的任务时,我想使用当前文件名,该任务在任务options
对象中作为模板变量处理。例如,在这里options['wrap-start']
:Grunt:在任务配置中获取当前文件名
swig_compile: {
temptarget: {
options: {
'wrap-start': 'var <%= CURRENT.FILE.NAME %> = function {', //I want the current file name as function name here
'wrap-end': '};'
},
files: {
'<%= config.app %>/scripts/tempcompiled.js': ['<%= config.app %>/templates/*.swig']
}
}
}