Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grunt Warning: Task "default" Not Found

Tags:

gruntjs

I am experimenting with Grunt and I am getting a Warning: Task "default" not found error when I try to run Grunt. my Gruntfile.js is

module.exports = function(grunt) {

grunt.initConfig({
concat: {
  js: {
    options: {
      separator: ';'
    },
    src: [
      'library/js/*.js'
    ],
    dest: 'library/js/scripts.min.js'
  },
},

uglify: {
  options: {
    mangle: false
  },
  js: {
    files: {
      'library/js/scripts.min.js': ['library/js/scripts.min.js']
    }
  }
},

less: {
  style: {
    files: {
      "library/css/style.css": "library/less/style.less"
    },
  }
},

watch: {
  js: {
    files: ['library/js/*.js'],
    tasks: ['concat:js', 'uglify:js'],
    options: {
        livereload: 35729
    }
  },
  css: {
    files: ['library/less/*.less'],
    tasks: ['less:style'],
    options {
        livereload: 35729
    }
  },
  php : {
    files : ['**/*.php'],
    options : {
      livereload : 35729
      } 
  }
}
  });



grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.registerTask('default', ['watch']);
};

This was working until I added the Livereload portions, and I think it might be a syntax error. However this is the first time I have used this and I simply don't know what is causing the problem. Any help would be greatly appreciated.

like image 563
micahmills Avatar asked Apr 09 '14 21:04

micahmills


1 Answers

You're missing a colon for watch.css.options. Update to:

css: {
    files: ['library/less/*.less'],
    tasks: ['less:style'],
    options: {
        livereload: 35729
    }
}
like image 57
thomaux Avatar answered Sep 23 '22 22:09

thomaux