2014-05-22 26 views
0

我努力做到以下幾點:咕嚕複製到位置都有附加全SRC路徑位置,而不僅僅是DEST財產

FOLDERS.GRUNT = "js/grunt" 

grunt.initConfig({ 
//copies from .tmp to final locations 
    copy: { 
     dist: { 
     files: [{ 
      expand: true, 
      dot: true, 
      dest: FOLDERS.GRUNT, 
      src: [ 
      FOLDERS.GRUNT + '/.tmp/*.js' 

      ] 
     } 
     ] 
     } 
    }, 

我希望這些文件在JS /咕嚕但最終在某種原因結束了JS /咕嚕/ JS /咕嚕/ .TMP/myfile.js

使用CWD也試過:FOLDERS.GRUNT,但有同樣的問題。

回答

0

好答案真的很簡單:

使用:

copy: { 
    dist: { 
    files: [{ 
     expand: true, 
     dot: true, 
     dest: FOLDERS.GRUNT, 
     flatten: true, 
     src: [ 
     FOLDERS.GRUNT + '/.tmp/*.js' 

     ] 
    } 
    ] 
    } 
}, 
1

這種做法將不平坦的目錄工作。

grunt.initConfig({ 
    copy: { 
    dist: { 
     files: [{ 
     cwd: FOLDERS.GRUNT + '/.tmp', 
     expand: true, 
     dest: FOLDERS.GRUNT, 
     src: ['*.js'] 
     }] 
    } 
    } 
});