1

为什么我在运行或 grunt时无法读取未定义 错误的属性摘要。当我运行 它显示grunt.filerev.summary不被识别为内部或外部命令。grunt filerev_applyfilerev_replacegrunt.filerev.summary

Gruntfile.js

module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

          filerev: {
            options: {
              algorithm: 'md5',
              length: 8
            },          

            images: {
              src: ['views/common/abc.html'],
            }
          },

          filerev_replace: {
            options: {
              assets_root: 'views/common/abc.html'
            },
            compiled_assets: {
              src: 'views/common/abc.html'
            },
            views: {
              options: {
                views_root: 'views/'
              },
              src: 'views/**/*.html'
            }
          },

           useminPrepare: {
            html: 'index.html',
            options: {
              dest: 'indexfolder'
            }
          },

          usemin: {
            html: 'indexfolder/index.html',
            options: {
                dirs: ['views','views1'],
              assetsDirs: ['views','views1'],
              revmap: ''
            }
          },

          filerev_apply: {
              files: [
                {
                  //expand: true,
                  //cwd: 'views',
                  src: ['views/**/*.html'],
                  //dest: 'views'
                }
              ]
            },

        reload: {
            //port: 8000,
            proxy: {
                host: 'localhost',
                port: 80
            }
        },
        watch: {
            sass: {
              files: ['views/**/*.html'],
              tasks: ['reload'],
              options: {
                livereload: true,
              }
            }
        }
    });
        grunt.loadNpmTasks('grunt-usemin');
        grunt.loadNpmTasks('grunt-contrib-watch');
        grunt.loadNpmTasks('grunt-contrib-connect');
        grunt.loadNpmTasks('grunt-reload');
        grunt.loadNpmTasks('grunt-filerev');
        grunt.loadNpmTasks('grunt-filerev-apply');
        grunt.loadNpmTasks('grunt-filerev-replace');

    grunt.registerTask('default', ['usemin', 'useminPrepare', 'watch','connect', 'reload', 'filerev', 'filerev_apply', 'filerev_replace']);
};
4

0 回答 0