Grunt文件块`必需的配置属性...缺少`

时间:2016-01-13 13:25:53

标签: javascript gruntjs

我似乎无法运行文件块。每次我运行grunt时都会收到以下错误消息:

Running "wiredep:app" (wiredep) task

Running "fileblocks:dev" (fileblocks) task
Verifying property fileblocks.dev exists in config...ERROR
>> Unable to process task.
Warning: Required config property "fileblocks.dev" missing. Use --force to continue.

Aborted due to warnings.

我有一个模块化设置,用于集成Grunt执行的各种任务。我通过运行npm install --save-dev grunt-file-blocks安装了文件块,我的Gruntfile.js是:

module.exports = function(grunt) {
  grunt.initConfig({
    pkg: require('./package.json')
  });

  grunt.loadTasks('grunt-tasks');
  grunt.registerTask('default', ['wiredep', 'fileblocks:dev']);
};

这是我的grunt-tasks/fileblocks.js

module.exports = function(grunt) {

  grunt.initConfig({
    fileblocks: {
      dev: {
        src: 'app/*.html',
        blocks: {
          'css': {
            src: 'app/*.css'
          },
          'js': {
            src: 'src/*.js'
          }
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-file-blocks');
};

因此,我希望fileblock:dev能够运行我已定义的文件块任务dev,但我收到了上述错误。救命啊!

0 个答案:

没有答案