Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/465.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Grunt usemin找不到目标_Javascript_Gruntjs_Yeoman_Grunt Usemin_Gruntfile - Fatal编程技术网

Javascript Grunt usemin找不到目标

Javascript Grunt usemin找不到目标,javascript,gruntjs,yeoman,grunt-usemin,gruntfile,Javascript,Gruntjs,Yeoman,Grunt Usemin,Gruntfile,我遵循了以下教程: 并且一直没有找到“有用”的目标 Grunfile.js: 源文件: /script/app/index.html /script/app/js/file2.js 该过程失败,结果index.html不包含指向缩小js文件的链接 谢谢您输入了一个错误,它是usemin:而不是usermin:问题出现在usemin路径中。。在详细模式下工作时,我能够理解它。以下是我的最终输出: module.exports = function(grunt) { grunt.init

我遵循了以下教程:

并且一直没有找到“有用”的目标

Grunfile.js:

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

该过程失败,结果index.html不包含指向缩小js文件的链接


谢谢

您输入了一个错误,它是
usemin:
而不是
usermin:

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



};