How to debug Angular application in VSCode using Edge browser?

前端 未结 2 1957
旧巷少年郎
旧巷少年郎 2021-01-13 04:37

I am using Edge extension. Below is configuration in launch.json:

\"configurations\": [
    {
      \"name\": \"ng serve\",
      \"type\": \"ed         


        
相关标签:
2条回答
  • 2021-01-13 05:23

    This configuration seems to work for me now. It breaks on the breakpoint and shows it as available.

     {
            "name": "Edge",
            "type": "edge",
            "request": "launch",
            "url": "http://localhost:4200/#",
            "webRoot": "${workspaceFolder}",
            "sourceMaps": true,
            "trace": true,
            "userDataDir": "${workspaceRoot}/.vscode/edge"
        }
    

    I guess they made some fixes.

    0 讨论(0)
  • 2021-01-13 05:40

    The following does hit the breakpoint, but they do show up as unverified in vscode (open circle). I think this might have to do with inline source maps.

    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "debug chrome",
                "type": "chrome",
                "request": "launch",
                "url": "http://localhost:4200/#",
                "webRoot": "${workspaceFolder}",
                "sourceMapPathOverrides": {
                    "webpack:/./*": "${webRoot}/*",
                    "webpack:/src/*": "${webRoot}/src/*",
                    "webpack:/*": "*",
                    "webpack:/./~/*": "${webRoot}/node_modules/*"
                }
            },
            {
                "name": "debug edge",
                "type": "edge",
                "request": "launch",
                "url": "http://localhost:4200/#",
                "webRoot": "${workspaceFolder}",
                "sourceMapPathOverrides": {
                    "webpack:/./*": "${webRoot}/*",
                    "webpack:/src/*": "${webRoot}/src/*",
                    "webpack:/*": "*",
                    "webpack:/./~/*": "${webRoot}/node_modules/*"
                },
    
            },
            {
                "name": "ng test",
                "type": "chrome",
                "request": "launch",
                "url": "http://localhost:9876/debug.html",
                "webRoot": "${workspaceFolder}"
            },
            {
                "name": "ng e2e",
                "type": "node",
                "request": "launch",
                "program": "${workspaceFolder}/node_modules/protractor/bin/protractor",
                "protocol": "inspector",
                "args": ["${workspaceFolder}/protractor.conf.js"]
            }
        ]
    }
    
    0 讨论(0)
提交回复
热议问题