2016-08-28 3 views
1

Ich bekomme den Fehler, obwohl alle im Code richtig zu sein scheint. Kann jemand helfen?Grunt Uglify zeigt Fehler

gruntfile.js

module.exports = function(grunt) { 

    // Project configuration. 
    grunt.initConfig({ 

     //Setting up some base links 
     meta: { 
      basePath: '../' 
     }, 

     //Reading package.json file 
     pkg: grunt.file.readJSON('package.json'), 

     // Concat Configuration 
     concat: { 
      options: { 
       separator: ';' 
      }, 
      dist: { 
       src: ['<%= meta.basePath %>scripts/*.js'], 
       dest: '<%= meta.basePath %>scripts/concated.js' 
      } 
     }, 

     // Uglify Configuration 
      uglify: { 
       build: { 
       src: ['<%= meta.basePath %>scripts/concated.js'], 
       dest: '<%= meta.basePath %>scripts/uglify.js' 
       } 
      } 
    }); 


    // These plugins provide necessary tasks. 
    grunt.loadNpmTasks('grunt-contrib-concat','grunt-contrib-uglify'); 

    // Default task 
    grunt.registerTask('default', ['concat','uglify']); 

}; 

ERROR

enter image description here

Bereits die Links zu sehen:

grunt uglify task failing
new to grunt - warning: task "concat, uglify" not found

"grunt concat" läuft jedoch gut und liefert Ergebnisse. Keine Probleme. Aber dieses Uglify scheint eine Menge Schmerz zu erzeugen.

+0

Sad! Niemand, der mir helfen könnte ??? – Deadpool

Antwort

0

try this excerpt from http://gruntjs.com/configuring-task:

uglify: { 
    static_mappings: { 
     // Because these src-dest file mappings are manually specified, every 
     // time a new file is added or removed, the Gruntfile has to be updated. 
     files: [ 
      { src: 'lib/a.js', dest: 'build/a.min.js' }, 
      { src: 'lib/b.js', dest: 'build/b.min.js' }, 
      { src: 'lib/subdir/c.js', dest: 'build/subdir/c.min.js' }, 
      { src: 'lib/subdir/d.js', dest: 'build/subdir/d.min.js' }, 
     ] 
    } 
} 
+0

hat nicht funktioniert bro ...! – Deadpool

Verwandte Themen