gpt4 book ai didi

javascript - grunt中的文件路径格式

转载 作者:行者123 更新时间:2023-11-29 17:55:15 25 4
gpt4 key购买 nike

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

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

'test/spec/{,*/}*.js' 是什么意思,它匹配什么?我也看到很多地方 js/**/*.js ,这是否意味着 js 中的所有文件夹?

最佳答案

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

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

应该扩展为:

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

匹配 test/spectest/spec 下的任何目录中的任何 .js 文件。

这与 'test/spec/**/*.js' 略有不同,它将匹配 test/spec< 中的任何 .js 文件 和任何目录 - 无论多深 - 在 test/spec 下。

关于javascript - grunt中的文件路径格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39763904/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com