npmvisual-studio-2017team-explorer

Hide solution files in node_modules from Team Explorer


Having moved from bower to npm in an ASP.Net Core MVC project that is under TFVC source control I now have an additional solution appearing in Team Explorer in Visual Studio 2017 that is in my node_modules folder:

.\node_modules\node-sass\src\libsass\win\libsass.sln

How can I stop this solution appearing in Team Explorer? node_modules is already in my .tfignore file and that folder/solution is not in source control.


Solution

  • This can be done by simply hiding the node_modules folder.

    I saw this as a side-effect when I was following instructions here, hiding the folder reduces the load times and memory footprint for Visual Studio as it doesn't try and preparse all the modules.

    Only the folder, not subfolders and files!

    As an alternative and a lighter touch @kakusan pointed out that only the solution file needs to be hidden. Be aware that this change may not be kept if NPM for some reason replaces the file.