Debugging 如何在VisualStudio代码中调试客户端?

Debugging 如何在VisualStudio代码中调试客户端?,debugging,visual-studio-code,Debugging,Visual Studio Code,根据,VisualStudio代码调试器应该能够调试typescript和javascript 问题是,它们只提供了使用node或python的服务器端应用程序的示例。Intellisense只建议使用服务器语言 是否可以使用Visual Studio代码调试器调试客户端typescript或javascript应用程序 launch.json { // Use IntelliSense to learn about possible Node.js debug attributes.

根据,VisualStudio代码调试器应该能够调试typescript和javascript

问题是,它们只提供了使用node或python的服务器端应用程序的示例。Intellisense只建议使用服务器语言

是否可以使用Visual Studio代码调试器调试客户端typescript或javascript应用程序

launch.json

{
    // Use IntelliSense to learn about possible Node.js debug attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [

        {
            "type":"node"      <-- what if I'm building a JS / TS app?
            "request": "launch",
            "name": "Launch Program",
            "program": "${file}",
            "outFiles": [
                "${workspaceRoot}/out/**/*.js"
            ]
        }
    ]
}
{
//使用IntelliSense了解可能的Node.js调试属性。
//悬停以查看现有属性的描述。
//有关更多信息,请访问:https://go.microsoft.com/fwlink/?linkid=830387
“版本”:“0.2.0”,
“配置”:[
{
“类型”:“节点”您必须安装一个(或多个)浏览器调试器扩展插件:,或

然后,您可以对Chrome使用如下启动配置:

{
    "type": "chrome",
    "request": "launch",
    "name": "Launch Chrome",
    "url": "http://localhost:8080",
    "webRoot": "${workspaceRoot}"
}

根据您构建的工作流,您可能需要执行一些附加步骤才能使源映射正常工作。

使用chrome调试器扩展查看我的答案。谢谢!太棒了!在哪里进行这些配置?是的,没错,但“url”参数设置为“”意味着必须启动中间web服务器。如何在Windows中建立和设置它?有简单的指南吗?