Visual Studio 代码,如何设置配置以仅显示来自根目录的脚本 package.json

Visual Studio Code, how to set a config to show scripts only from the root package.json

我的项目中有多个 package.json 文件在不同的文件夹中。 VSCode 从所有文件中读取脚本并将它们显示在“NPM 脚本”面板中。我只想显示根 package.json 文件中的脚本。如何将配置添加到项目以仅读取根目录 package.json 或为其设置精确路径。可能吗?感谢您的帮助

不确定为什么这个 glob 有效,但这个设置(在 settings.json 中)似乎有效:

"npm.exclude": "**/folder-operations/**"

其中 folder-operations 将是您的根文件夹。