0
我在编写本机函数时遇到问题,它会将我的文件从一个目录复制到另一个目录,并排除某些文件和目录。Grunt Task - Movig文件从一个文件夹到另一个文件夹
module.exports = function(grunt) {
grunt.initConfig({
//....
copy: {
prod: {
src: ["./src/*"],
dest: ["build/"]
}
}
}
}
这里是我的自定义任务负载:
grunt.loadNpmTasks('copy', function(){
var src = grunt.config.get('copy.src'),
dest = grunt.config.get('copy.dest'),
grunt.file.copy(src, dest);
});
我在控制台收到此错误:
警告:任务 “拷贝” 找不到。
不过,我觉得这是本地咕噜功能regarging到: http://gruntjs.com/api/grunt.file
然后我督促这个样子的:
grunt.registerTask("prod", ["concat", "uglify", "htmlmin", "imagemin", "copy"]);