1

I am getting the error though all seems to be right in the code. Can someone help?

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

Already seen the links:

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

However, "grunt concat" runs fine and provide results. No issues. But this uglify seems to create a lot of pain.

Community
  • 1
  • 1
Deadpool
  • 7,811
  • 9
  • 44
  • 88

1 Answers1

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' },
        ]
    }
}
RandyDaddis
  • 1,020
  • 10
  • 19