0

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

4

2 に答える 2

2

問題はuseminパスにありました..詳細モードで作業しているときにそれを理解できました。これが私の最終出力です:

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'
]);



};
于 2015-09-25T16:45:58.567 に答える