GruntJS setup: no targets found

The code

My last commit is in a repo on GitHub .

Problem...

I am creating a project (link above) using GruntJS. When I try to complete any Grunt task, I get No "<insert-taskname>" targets found; a few examples:

  • No targets found for "browserSync". Warning: Failed to complete the "browserSync" task. Use -force to continue.

  • No targets found for "jshint". Warning: The jshint task did not complete. Use -force to continue.

  • No sass targets found. Warning: The sass task failed. Use -force to continue.

What am I doing

.js Grunt, load-grunt-configs. . Grunt, Gruntfile.js grunt-configs, options, load-grunt-configs.

, ...

Grunt, , , .

! .

+4
2

Gruntfile. API- Grunt.

tasks/ , , .

Grunt grunt.loadTasks():

// Gruntfile.js
module.exports = function(grunt) {
  // Initialize config.
  grunt.initConfig({
    pkg: require('./package.json'),
  });

  // Load per-task config from separate files.
  grunt.loadTasks('tasks');
};

mini Gruntfiles. jshint:

// tasks/jshint.js
module.exports = function(grunt) {
  grunt.config('jshint', {
    app: {
      options: {jshintrc: 'app/.jshintrc'},
      src: ['app/**/*.js'],
    },
  });
  grunt.loadNpmTasks('grunt-contrib-jshint');
};

Grunt: https://github.com/cowboy/wesbos

+3

.

module.exports = {

:

module.exports.tasks = {

, , grunt!

+1

All Articles