【发布时间】:2016-01-02 09:16:07
【问题描述】:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
files: [
{expand: true,cwd:"js/" ,src: ['libs/*'], dest: '../test/js/libs/'},
{expand: true,cwd:"js/" , src: ['models/*'], dest: '../test/js/models/'}
]
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask("testcopy",["copy"] );
);
我正在学习 grunt 并且在复制时遇到以下问题。
Warning: undefined is not a function Use --force to continue.
并且文件未从 src 复制到目标
【问题讨论】:
-
上述代码的哪一行发生了错误?
-
它没有提供任何行号。只是一条消息警告:未定义不是函数使用--force继续。
-
有一个
);而不是};这是您的代码错误还是堆栈溢出?
标签: javascript gruntjs grunt-contrib-copy