Visual Studio Code shows configured and auto-detected tasks in its Run Tasks
menu. I would like to exclude the bin
folder and all its subfolders from the npm task auto-detection. The npm.exclude setting appears to be designed for that purpose, but I haven't found how to use it.
I tried the following variations, with no success:
"npm.exclude": "**/bin"
"npm.exclude": "**/bin/"
"npm.exclude": "./bin"
"npm.exclude": "./bin/"
"npm.exclude": "**/bin/*.*"
"npm.exclude": "./bin/*.*"
"npm.exclude": ["**/bin"]
"npm.exclude": ["**/bin/"]
"npm.exclude": ["./bin"]
"npm.exclude": ["./bin/"]
"npm.exclude": ["**/bin/*.*"]
"npm.exclude": ["./bin/*.*"]
The syntax used for files.exclude
and search.exclude
doesn't appear to be allowed:
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true
}
What is the appropriate syntax for the npm.exclude
setting?
To exclude a folder, go to File > Preferences, and search for file. exclude in the search settings. You can add the pattern of the folder you don't want Visual Studio Code to open.
You can go to that specific directory or create shortcut to desktop then click right click on that folder and then click on open with code. If you didnot see open with code then reinstall your VS code and check on open with code when you are reinstalling VS Code.
The File > Add Folder to Workspace command brings up an Open Folder dialog to select the new folder. Once a root folder is added, the Explorer will show the new folder as a root in the File Explorer. You can right-click on any of the root folders and use the context menu to add or remove folders.
"npm.exclude" requires a "string and uses glob. So, my settings for npm.exclude, with multiple rules:
"npm.exclude": "**/@(vendor|node_modules|bower_components|dist|static)/**"
Try (in your settings.json
)
"npm.exclude": "**/bin/**"
that works for me to exclude scripts in workspaceFolder/bin/package.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With