2013-08-24 77 views
4

我已經寫了下面的文件grunt.js咕嚕沒有目標發現問題

var _path = require('path'); 

module.exports = function (grunt) { 
    var config = { 
    }; 


    function addProject(project) { 
     grunt.helper('addProject', config, project); 
    } 

    addProject({ 
     name:'mytest', 
     type:'module', 
     sourcePath:'../source', 
     outputPath:'../test/', 
     version : grunt.option('ver')||'0.1.0.0' 
    }); 

    grunt.registerTask('default', 'module closureCompiler'); 
    grunt.initConfig(config); 
}; 
當我在我的bat文件模塊closureCompiler同步使用命令它運行

,它提供了一個錯誤說

Running "sync" task 
>> No "sync" targets found. 
<WARN> Task "sync" failed. Use --force 

這是什麼意思?

+0

什麼參數,你傳遞給它到底是什麼?您尚未配置同步任務。 – JJJ

+0

好的告訴我howaand我應該在哪裏配置同步任務? – user1224036

+1

https://github.com/tomusdrw/grunt-sync/blob/master/readme.md – JJJ

回答

5

隨着錯誤消息指出您需要定義一個目標爲sync任務:

grunt.initConfig({ 
    sync: { 
     target: {} // <= needs to be defined 
    } 
});