angularjsgruntjsgruntfile

Warning: Task "default" not found


Here is my Gruntfile.js

module.exports = function(grunt) {
  require('logfile-grunt')(grunt, {
    filePath: './logs/grunt.log',
    clearlogFile: true
  });
  grunt.initConfig({
    // pkg: grunt.file.readJSON('package.json'),
    connect: {
      server: {
        options: {
          port: 9001,
          hostname: '*',
          middleware: function(connect, options) {
            return [
              function(req, res, next) {
                res.setHeader('X-UA-Compatible', 'IE-edge');
                next();
              }
              connect.static('project')
            ]
          }
        }
      }
    },
    watch: {
      options: {
        livereload: true
      },
      files: ['project/**/*.js', 'project/**/*.html', 'project/**/*.css'],
      task: []
    }
  });

  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-watch');

  grunt.registerTask('default', ['connect:server', 'watch']);
};

enter image description here

enter image description here


Solution

  • you forgot write coma in return array

    return [
        function(req, res, next) {
            res.setHeader('X-UA-Compatible', 'IE-edge');
            next();
         },
         connect.static('project')
    ]