Fine Tuning VS Code Search for SPFx Projects - leberns/SharePoint GitHub Wiki

Fine-Tuning VS Code Search for SPFx Projects

How to exclude the folders of SPFx projects from VS Code search, this is useful to look for texts in your source code folders and not in other folders, as it might happen.

In your SPFx project:

  • open or create the .vscode folder, settings.json file
  • type "search.exclude", the current settings are auto completed.
  • add the lines to exclude the folders: temp, dist, lib, as seen below

Setting:

{

  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "**/*.code-search": true,
    "**/temp": true,
    "**/dist": true,
    "**/lib": true,
  },

}

Example before and after applying the setting:

It is possible configure the settings manually in VS Code, go to File > Preferences > Settings and type file.search, look for Search: Exclude

Note: you might like to apply those settings at user level.

References

10 Tricks Every Developer Should Know in Visual Studio Code

⚠️ **GitHub.com Fallback** ⚠️