我對grunt來說相當陌生,從字面上看只有幾個小時。我正在使用grunt-cache-breaker設置grunt來緩存我的網站。現在,我已經得到了它,當我手動輸入每個文件源示例工作:從外部文件加載Grunt任務屬性
grunt.initConfig({
cachebreaker: {
dev: {
options: {
match: ['.js', '.css', 'min.css'],
src: {
path: 'TEST/Apps/**/*'
}
},
files: {
src: ['TEST/Apps/AppTemplate/v1.0.0/index.html',
'TEST/Apps/Case_Attributes/v1.0.0/index.html',
'TEST/Apps/Case_CorrespondenceReferences/v1.0.0/index.html',
',
]
}
},
},
});
但是我真正想要做的是能有問題從預先生成的文本文件,這樣構築files.src名單:
grunt.initConfig({
cachebreaker: {
dev: {
options: {
match: ['.js', '.css', 'min.css'],
src: {
path: 'TEST/Apps/**/*'
}
},
files: {
src: function(){
return grunt.file.read('config.txt')
}
}
},
},
});
或其他影響。這可能嗎?還是我完全不符合標準?