2016-04-03 65 views
0

有人可以帮助我,告诉我我在这里做错了什么。我想要将css文件从构建目录移动到我的项目的根目录下面的grunt任务。简单的咕噜复制任务不起作用

module.exports = { 
    copy: { 
     main: { 
      files: [{ 
       expand: true, 
       cwd: "build/css/", 
       src: "style.css", 
       dest: "../" 
      }] 
     }, 
    }, 
} 

当我运行grunt copy -v这是什么东西说:

$ grunt copy -v 
Initializing 
Command-line options: --verbose 

Reading "Gruntfile.js" Gruntfile...OK 

Running tasks: copy 

Running "copy" task 

Running "copy:copy" (copy) task 
Verifying property copy.copy exists in config...OK 
File: [no files] 
Options: encoding="utf8", processContent=false, processContentExclude=[], timestamp=false, mode=false 


Done, without errors. 
+0

我觉得文件属性不应该有括号[],也许尝试运行grunt复制:主 – Terafor

+0

当我尝试复制:主要我得到以下内容: 运行“copy:main”(复制)任务 验证属性copy.main存在于config ...错误 >>无法处理任务。 警告:需要配置属性“copy.main”缺失。使用--force继续。 由于警告而中止。 –

回答

0

别担心,算出来。太晚了晚上这个... :(

的任务是逃跑的文件名,以便去除copy现在它的工作原理。

module.exports = { 
    main: { 
     files: [{ 
      expand: true, 
      cwd: "build/css/", 
      src: "style.css", 
      dest: "../" 
     }] 
    }, 
}