【发布时间】:2015-04-02 05:04:38
【问题描述】:
我想编写一个 Grunt 任务,在构建过程中,它会复制我拥有的所有 .html 文件,并在 /dist 中创建它的 .asp 版本。
我一直在尝试使用grunt-contrib-copy 来完成此操作,这就是我所拥有的:
copy: {
//some other tasks that work...
//copy an .asp version of all .html files
asp: {
files: [{
expand: true,
dot: true,
cwd: '<%= config.app %>',
src: ['{,*/}*.html'],
dest: '<%= config.dist %>',
option: {
process: function (content, srcpath) {
return srcpath.replace(".asp");
}
}
}]
} //end asp task
},
我知道process 函数实际上并不正确...我尝试了一些不同的正则表达式以使其无济于事。当我运行asp 任务时,Grunt CLI 说我已经复制了 2 个文件,但找不到它们。任何帮助表示赞赏。
【问题讨论】:
标签: gruntjs grunt-contrib-copy