当指定了cwd选项时,Grunt-contrib-copy任务失败

10

我有这个 grunt-copy 设置:

copy: {
        images: {
            cwd: 'src/multiselect/lib/',
            src: 'chosen.css',
            dest: './built/css/',
            flatten: true,
            filter: 'isFile'
        }
    },

当我运行它时,它总是会这样:

Running "copy:images" (copy) task
Warning: Unable to read "chosen.css" file (Error code: ENOENT). Use --force to continue.
Aborted due to warnings.

奇怪的是,如果我使用这个配置运行它:

copy: {
        images: {
            src: 'src/multiselect/lib/chosen.css',
    //      src: 'chosen.css',
            dest: './built/css/',
            flatten: true,
            filter: 'isFile'
        }
    },

每次都有效。有人知道为什么吗?似乎错误发生在这行代码上:

grunt.file.copy(src, dest, copyOptions); 
在grunt-contrib-copy任务中。非常感谢任何帮助。
1个回答

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接