javascript - tsconfig.json 中的 **/node_modules/* 是什么意思?
问题描述
在这个 Visual Code的官方文档中,建议添加node_modules
到exclude
tsconfig.json 的字段中。这样做是这样的:
{
"compilerOptions": {
"allowJs": true,
"checkJs": true
},
"exclude": ["node_modules", "**/node_modules/*"]
}
**/node_modules/*
我想知道如果我已经添加了普通node_modules
文件夹,为什么还需要它。
解决方案
**/node_modules/*
是一个 glob 模式,意思是(从右到左)“任何深度node_modules
的目录下的任何东西”。有关更多详细信息,请参阅模块,它很可能是用于解释该模式的模块。glob
从他们的文档中:
*
匹配单个路径部分中的 0 个或多个字符**
如果“globstar”在路径部分中单独存在,则它匹配零个或多个目录以及搜索匹配项的子目录。它不会爬取符号链接的目录。
推荐阅读
- java - Rxjava 可观察到的不兼容类型
- django - 如何在 django URL 上为导入的视图设置身份验证和权限
- r - 如何在R中滞后数据框的特定列
- algorithm - 用给定函数形式逼近未知函数的算法?
- lucene - 如何将 createComponents 从 Lucene 4.5 迁移到 8.20
- logging - serilog :仅在应用程序停止后记录
- java - Lombok 自定义构建方法可选,表示无法引用非静态变量
- database - 连接到本地嵌入式 H2 数据库
- android - java.lang.RuntimeException:无法创建类 yodgorbek.komilov.musobaqayangiliklari.viewmodel.MainViewModel 的实例?
- reactjs - 使用 OptGroups 在 Ant Design Select Component 中搜索时忽略变音符号