Angular CLI 1.7.0 and Visual Studio Code - can't set breakpoints

前端 未结 6 1026
执念已碎
执念已碎 2020-11-29 07:46

I\'m using the Chrome Debugger plugin in Visual Studio Code to debug an Angular application. After upgrading to use angular/cli@1.7.0, we can no longer hit breakpoints in t

6条回答
  •  攒了一身酷
    2020-11-29 08:20

    Angular CLI 7.2.2:

    Webstorm/Intellij - breakpoints never hit, VSCode - breakpoints unverified/never hit, Chrome debugger - breakpoints hit perfectly.

    Solution: in angular.json set evalSourceMap to "false".

    This triggers the Webpack that Angular CLI uses under the hood to generate source maps to original source code ("source-map") instead of generated code ("eval"). https://webpack.js.org/configuration/devtool

    See under node_modules@angular-devkit\build-angular\src\angular-cli-files\models\webpack-configs\browser.js

    You can of course hack the browser.js file to set some other value for devtool.

提交回复
热议问题