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"]);