2016-10-09 10 views
0

私はGruntを時計タスクでコンパイルするように設定しましたが、今は有用なファイルをbower_components/...からコピーしたいと思います。 bower_components/jquery/jquery.min.js。bowerは不要なファイルをたくさん生成するので、サーバーにアップロードするときに取り除きたいものです。grunt-bowercopyは警告を出します - ファイルはコピーされません

CMDは警告を出し、処理を停止します。

Reading C:\Users\sjiamnocna\Documents\NetBeansProjects\PM_new\node_modules\grunt-bowercopy\package.json...OK 
Parsing C:\Users\sjiamnocna\Documents\NetBeansProjects\PM_new\node_modules\grunt-bowercopy\package.json...OK 
Reading bower.json...OK 
Parsing bower.json...OK 
Loading "bowercopy.js" tasks...OK 
+ bowercopy 
Loading "gruntfile.js" tasks...OK 
+ default, dog 

No tasks specified, running default tasks. 
Running tasks: default 

Running "default" task 

Running "bowercopy" task 

Running "bowercopy:copythat" (bowercopy) task 
Verifying property bowercopy.copythat exists in config...OK 
File: [no files] 
Options: srcPrefix="bower_components", destPrefix="files", ignore=[], report, runBower=false, clean=false, copyOptions={} 
Using srcPrefix: bower_components 
Using destPrefix: files 
Warning: Nothing was copied for the "copythat" target Use --force to continue. 

マイgruntfile:

module.exports = function (grunt) { 
    grunt.initConfig({ 
     watch: { 
      scss: { 
       files: ['files/style/sass/*.scss'], 
       tasks: ['compass'] 
      } 
     }, 
     compass: { 
      dist: { 
       options: { 
        sassDir: 'files/style/sass', 
        cssDir: 'files/style', 
        environment: 'development' 
       } 
      } 
     }, 
     bowercopy: { 
      copythat: { 
       options: { 
        runBower: false, 
        srcPrefix: 'bower_components', 
        destPrefix: 'files' 
       }, 
       script: { 
        'jquery/dist/jquery.min.js': 'script/lib/jquery.min.js', 
        'jquery-ui/jquery-ui.min.js': 'script/lib/jquery-ui.min.js', 
        'masonry/dist/masonry.pkgd.min.js': 'script/lib/masonry.pkgd.min.js', 
        'sweetalert/dist/sweetalert.min.js': 'script/lib/sweetalert.min.js' 
       } 
      } 
     } 
    }); 
    grunt.loadNpmTasks('grunt-contrib-watch'); 
    grunt.loadNpmTasks('grunt-contrib-compass'); 
    grunt.loadNpmTasks('grunt-bowercopy'); 

    grunt.registerTask('default', ['bowercopy']); 
    grunt.registerTask('dog', ['watch']); 

}; 

誰が間違って何を教えてもらえますか?それとも、他の方法でそれをやっているのですか(自動的に:))?

+0

'copythat'では、' script'キーの名前を 'files'に変更します。 – cartant

答えて

0

おかげでコメント@cartant、それは私が作った過ちの一つであった - 私は、リソースの位置を変更し、

間違った目標ました代わりに、「ファイル」

のものは何でも使って:

'source':'target' 

が向上:

'target':'source' 

作品を!

関連する問題