我似乎无法运行文件块。每次我运行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
,但我收到了上述错误。救命啊!