javascriptgruntjsyeomangrunt-usemingruntfile

Grunt usemin getting no targets found


I followed the following tutorial: https://www.youtube.com/watch?v=gIbfDxF69c8

and keep getting No "usemin" targets found.

gruntfile.js: http://www.billiving.com/demo/script/gruntfile.js

source files: /script/app/index.html /script/app/js/file2.js

The process fails and the resulting index.html doesn't contain a link to the minified js file.

Thanks


Solution

  • Problem was in usemin path.. I was able to figure it out when working in verbose mode. Here's my final output:

    module.exports = function(grunt) {
        grunt.initConfig({
    
        useminPrepare:{
              html: 'index.html',
              options:{
                  dest:'build'
                }
        },
    
        usemin: {
          html: 'build/index.html'
         },
    
    
    
        copy :{
    
            task1: {expand: true, src: ['Partials/**', 'Nav/**', 'Resources/Images/**', 'Resources/packages/**', 'Resources/invoices/**', 
            'config.js', 'index.html', 'favicon.ico'], dest:'build/'},
        }       
    
    });
    
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-usemin');
    
    
    grunt.registerTask('default',[
      'copy:task1',
      'useminPrepare',
      'concat',
      'uglify',
      'cssmin',
      'usemin'
    ]);
    
    
    
    };