grunt中的文件路径格式

时间:2016-09-29 07:22:28

标签: javascript gruntjs

我有一个由Yomen生成的grunt文件,有一个文件路径定义为

test: {
  options: {
    jshintrc: 'test/.jshintrc'
  },
  src: ['test/spec/{,*/}*.js']
}

'test/spec/{,*/}*.js'的含义是什么? 我也见过很多地方js/**/*.js,这是指js中的所有文件夹吗?

1 个答案:

答案 0 :(得分:4)

根据node-glob documentation,glob的大括号括起部分扩展了大括号内逗号分隔的部分。所以这个:

['test/spec/{,*/}*.js']

应该扩展到:

['test/spec/*.js', 'test/spec/*/*.js']

匹配.jstest/spec下的任何目录中的所有test/spec个文件。

这与'test/spec/**/*.js'略有不同,.js会匹配test/spec和任何目录中的所有test/spec个文件 - 无论多深 - <select ng-model="car"> <option value="">Select a category</option> <optgroup ng-repeat="cGroup in categoriesBody" label="{{cGroup.parentCategoryName}}"> <option ng-repeat="subCategory in cGroup.subCategories" value="subCategory.subCategoryID"> {{subCategory.subCategoryName}} </option> </optgroup> </select> 下。

相关问题