minimatch
)来匹配所有不在特定目录中的JavaScript文件。不幸的是,我使用的另一个工具没有暴露任何选项(如ignore
glob),因此必须使用单个glob来完成任务。
这是我目前拥有的内容
示例输入(它不应该匹配顶部,但它应该匹配底部):
docs/foo/thing.js
docs/thing.js
client/docs/foo/thing.js
client/docs/thing.js
src/foo/thing.js
src/thing.js
docs-src/foo/thing.js
docs-src/thing.js
client/docs-src/foo/thing.js
client/docs-src/thing.js
以下是我对全局模式的现有内容:
**/!(docs)/*.js
我正在匹配 docs/foo/thing.js
和 client/docs/foo/thing.js
,而不是匹配 docs-src/thing.js
或 client/docs-src/thing.js
。如果我将我的glob切换为** /!(docs)/**/*.js
,那么我可以匹配client/docs-src/thing.js
,但我也会匹配client/docs/thing.js
。
我不确定这是否可能,所以我可能需要找到另一个解决方案来解决我的问题 :-/