GruntJS-美化插件:警告:无法读取属性';src&x27;未定义用途——强制继续

GruntJS-美化插件:警告:无法读取属性';src&x27;未定义用途——强制继续,gruntjs,Gruntjs,我正在尝试使用GruntJS来完成一个简单的任务,使用GruntBeautify插件来美化一些js/css。这是最基本的任务,我不能让beautify没有错误地运行。丑陋任务运行良好,我只是不认为美化任务有问题 /*global module:false*/ module.exports = function(grunt) { // Project configuration. grunt.initConfig({ // Task configuration. beau

我正在尝试使用GruntJS来完成一个简单的任务,使用GruntBeautify插件来美化一些js/css。这是最基本的任务,我不能让beautify没有错误地运行。丑陋任务运行良好,我只是不认为美化任务有问题

/*global module:false*/
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    // Task configuration.
    beautify: {
      files: {
         src: '../myProject/css*/*.css',
         dest: './'
      }
    },
    uglify: {
      files: {
         src: 'dev/*.css'
      }
    },
  });

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-beautify');

  // Default task.
  //grunt.registerTask('default', ['beautify']);

};


Registering "grunt-beautify" local Npm module tasks.
Reading /path/to/grunt/node_modules/grunt-beautify/package.json...OK
Parsing /path/to/grunt/node_modules/grunt-beautify/package.json...OK
Loading "beautify.js" tasks...OK
+ beautify
Loading "Gruntfile.js" tasks...OK
>> No tasks were registered or unregistered.

Running tasks: beautify

Running "beautify" task
[D] Task source: /path/to/grunt/node_modules/grunt-beautify/tasks/beautify.js

Running "beautify:files" (beautify) task
[D] Task source: /path/to/grunt/node_modules/grunt-beautify/tasks/beautify.js
Verifying property beautify.files exists in config...OK
Files: ../myProject/css_3.3.6/bootstrap.min.css, ../myProject/css_3.3.6/fonts.css, ../myProject/css_3.3.6/styles.css -> ./
Using beautifier default options.
Warning: Cannot read property 'src' of undefined Use --force to continue.
TypeError: Cannot read property 'src' of undefined
    at Object.<anonymous> (/path/to/grunt/node_modules/grunt-beautify/tasks/beautify.js:52:37)
    at Object.<anonymous> (/path/to/grunt/node_modules/grunt/lib/grunt/task.js:264:15)
    at Object.thisTask.fn (/path/to/grunt/node_modules/grunt/lib/grunt/task.js:82:16)
    at Object.<anonymous> (/path/to/grunt/node_modules/grunt/lib/util/task.js:296:30)
    at Task.runTaskFn (/path/to/grunt/node_modules/grunt/lib/util/task.js:246:24)
    at Task.<anonymous> (/path/to/grunt/node_modules/grunt/lib/util/task.js:295:12)
    at /path/to/grunt/node_modules/grunt/lib/util/task.js:222:11
    at process._tickCallback (node.js:419:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)

Aborted due to warnings.
/*全局模块:false*/
module.exports=函数(grunt){
//项目配置。
grunt.initConfig({
//任务配置。
美化:{
档案:{
src:'../myProject/css*/*.css',
目的地:'./'
}
},
丑陋的:{
档案:{
src:'dev/*.css'
}
},
});
//这些插件提供了必要的任务。
grunt.loadNpmTasks(“grunt-contrib-uglify”);
grunt.loadNpmTasks(“grunt-beautify”);
//默认任务。
//registerTask('default',['beautify']);
};
注册“grunt美化”本地Npm模块任务。
正在读取/path/to/grunt/node_modules/grunt美化/package.json…好的
解析/path/to/grunt/node_modules/grunt美化/package.json…好的
正在加载“beautify.js”任务…好的
+美化
正在加载“Gruntfile.js”任务…好的
>>未注册或取消注册任何任务。
跑步任务:美化
运行“美化”任务
[D] 任务源:/path/to/grunt/node_modules/grunt belify/tasks/belify.js
运行“美化:文件”(美化)任务
[D] 任务源:/path/to/grunt/node_modules/grunt belify/tasks/belify.js
正在验证配置中是否存在属性beautify.files…确定
文件:../myProject/css_3.3.6/bootstrap.min.css,../myProject/css_3.3.6/fonts.css,../myProject/css_3.3.6/styles.css->/
使用美化默认选项。
警告:无法读取未定义用途的属性“src”-强制继续。
TypeError:无法读取未定义的属性“src”
反对。(/path/to/grunt/node_modules/grunt-bestify/tasks/bestify.js:52:37)
反对。(/path/to/grunt/node_modules/grunt/lib/grunt/task.js:264:15)
在Object.thisTask.fn(/path/to/grunt/node_modules/grunt/lib/grunt/task.js:82:16)
反对。(/path/to/grunt/node_modules/grunt/lib/util/task.js:296:30)
在Task.runTaskFn(/path/to/grunt/node_modules/grunt/lib/util/Task.js:246:24)
正在执行任务。(/path/to/grunt/node_modules/grunt/lib/util/task.js:295:12)
at/path/to/grunt/node_modules/grunt/lib/util/task.js:222:11
在进程中调用(node.js:419:13)
位于Function.Module.runMain(Module.js:499:11)
启动时(node.js:119:16)
由于警告而中止。

忍不住注意到

beautify: {
  files: {
     src: '../myProject/css*/*.css',
     dest: './'
  }
}
但是应该在.js文件而不是.css文件上运行。项目中也没有任何其他建议