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']
}
}
}