【问题标题】:Typescript in visual code and node_modules可视代码和 node_modules 中的打字稿
【发布时间】:2018-12-29 06:17:07
【问题描述】:

我已安装 typescript,并且正在使用 可视化代码。

如果我尝试定义位于 node_modules 中的打字稿函数,Visual Studio 会展开整个“node_modules”文件夹,我必须再次关闭它。

这太荒谬了。

我怎样才能阻止这种情况发生

【问题讨论】:

标签: node.js typescript visual-studio-code


【解决方案1】:

在 VSCode 中,如果你在 vscode 的用户设置中有两个选项:

  1. explorer.autoReveal设置为false,将禁用打开文件时自动显示文件;
  2. "**/node_modules":true 添加到files.exclude,将从探索窗格中隐藏node_modules 文件夹;

【讨论】:

  • 如果您在其中打开了文件,这些设置都不会阻止 node_modules 文件夹扩展
  • 如果将"**/node_modules":true添加到files.exclude,则在vscode的资源管理器窗格中看不到node_modules目录。如果它仍然在这里,请尝试保存您的设置并重新加载 vscode。
猜你喜欢
  • 2017-12-10
  • 2018-10-17
  • 1970-01-01
  • 2018-10-15
  • 2019-04-11
  • 2018-05-18
  • 2018-09-30
  • 1970-01-01
  • 2017-05-31
相关资源
最近更新 更多