【问题标题】:Grunt usemin getting no targets foundGrunt usemin 找不到目标
【发布时间】:2015-08-21 09:59:21
【问题描述】:

我按照以下教程进行操作: https://www.youtube.com/watch?v=gIbfDxF69c8

并不断收到没有找到“usemin”目标。

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

源文件: /script/app/index.html /script/app/js/file2.js

进程失败,生成的 index.html 不包含指向缩小的 js 文件的链接。

谢谢

【问题讨论】:

    标签: javascript gruntjs yeoman grunt-usemin gruntfile


    【解决方案1】:

    问题出在 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'
    ]);
    
    
    
    };
    

    【讨论】:

      【解决方案2】:

      你打错了,是usemin:而不是usermin:

      【讨论】:

        猜你喜欢
        • 2013-12-29
        • 2013-07-22
        • 1970-01-01
        • 2017-08-07
        • 1970-01-01
        • 1970-01-01
        • 2018-11-27
        • 2012-11-04
        • 1970-01-01
        相关资源
        最近更新 更多