在setting.json里添加

{
    "search.exclude": {
        "**/node_modules":false
    },
    "search.useIgnoreFiles":false
}

1.将**/node_modules设为false,从而禁用缺省行为,从而支持node_modules目录的检索
对于许多项目而言,将**/node_modules设为false就已经足够了。那么,为什么还需要将2.search.useIgnoreFiles设为false呢?这是因为有的项目包含.gitignore文件,而.gitignore文件中忽略了node_modules目录,这个机制仍然限制了VSCode对node_modules目录的检索。因此,我们需要配置该参数,从而忽略这种默认行为

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐