Stop Chrome DevTools from opening script files when debugging angular app

Viewed 281

When I start debugging my angular app and open the chrome DevTools then a lots of files are opening by itself in the sources window. Most of them are files from vendor scripts.

I was looking for the 'debugger' - Keyword in the scripts but didn't see any.

The most of those files are .js - files. I suspected the angular-cli is serving sourcemaps for vendor scripts which would eventually cause that behavior. So I put that into my angular.json file:

   "serve": {
      "builder": "@angular-devkit/build-angular:dev-server",
      "options": {
        "browserTarget": "quickapp:build",
        "vendorSourceMap": false
      },

That didn't help. Any suggestions?

I am using angular 7

--- Update ---

My colleague just mentioned that this only happens when the "Script Debugging" in visual studio is enabled and I can confirm that now. So the cause here is the Visual Studio Script Debugging Feature. This feature is not really reliable. Breakpoints are sometimes not working (especially after a visual studio update). So you have to use the devtools combined with the script debugging.

So there is still the question, is that a bug or is it possible to change that behavior?

0 Answers
Related