1
我试图在目录中对所有文件进行模板化,并将结果放在bin/admin
目录中,以使目标文件与源文件具有相同的名称。但是,data
中的dest
好像是文件的名称,不能指定为目标目录。Grunt:目标文件模板后与源文件名称相同
module.exports = function(grunt) {
grunt.initConfig({
'template': {
'process-html-template': {
'options': {
'data': {
'api_url': 'My blog post'
}
},
'files': {
'bin/admin/': ['src/admin/*'] // <-- Here
}
}
}
});
grunt.loadNpmTasks('grunt-template');
grunt.registerTask('default', ['template']);
}
我能做些什么,以模板上的所有文件的src/
并把它们在目标文件夹具有相同名称的来源?我尝试使用bin/admin/*
作为目的地,但只是在bin/admin
中创建一个文件名为*
的文件。我想避免手动列出源目录中的所有文件。