需要打开调试并向localhost显示页面:8080

0dxa2lsx  于 2021-09-29  发布在  Java
关注(0)|答案(1)|浏览(507)

我需要在调试中打开浏览器,他需要打开谷歌浏览器的链接

localhost:8080

在我的 luch.json 我有:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "url":"http://localhost:8080",
            "type": "pwa-chrome",
            "request": "launch",
            "name": "Open index.html",
            "file": "c:\\Users\\franc\\Desktop\\Angular js\\Progetti\\Modulo 4 routing\\codice mio\\index.html",

        }
    ]

}

问题在于google chrome调试是否指向此链接:

file:///C:/Users/franc/Desktop/Angular%20js/Progetti/Modulo%203%20Controlli/Codice%20mio/index.html/orders

什么也没装。有人能帮我用loalhost:8080中的VisualStudio代码打开调试控制台并加载数据吗?

0qx6xfy6

0qx6xfy61#

将此添加到您的配置中,

"version": "0.2.0",
"configurations": [
    {
        "name": "Debug in Chrome",
        "type": "chrome",
        "request": "launch",
        "port": 9229,
        "webRoot": "${workspaceRoot}/src",
        "runtimeArgs": [
            "debug:start"
        ],
        "resolveSourceMapLocations": [
            "${webRoot}/**",
            "!**/node_modules/**"
        ]
    }
]

chrome.exe --remote-debugging-port=9229 从您的终端/cmd。
workspaceroot指定Web服务器根的工作区绝对路径。用于将/app.js等路径解析为磁盘上的文件。“/”的路径Map的简写形式。

相关问题