Is there a way to automatically collapse the Script Documents section in solution explorer?

Right click the projects you are interested in working on and click on 'Scope to this'. This will hide everything (Including the scripts folder) except those projects you selected.

Visual Studio 'scope to this' example


I got annoyed enough with this that I turned off JavaScript debugging. If you are willing to go that far, the scripts are gone.

The path for turn of JS debugging is:

Tools -> Options -> Debugging -> General -> Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE) (Visual Studio 2017 and 2019)

Note: This method does not prevent you from stepping though JS in the Chrome inspection tools so you do not lose that ability. You lose both the scripts (of course) and that new Chrome window that pops up when you launch the debugger.


Yes, there is.

Disable Script Debugging

IIS Express > Script Debugging > Disabled


Right click then 'Scope to This' to hide everything but the project in the solution you want to view.

Click on the Home/House icon to reverse it.