json VS Code Chrome调试器 - 如何配置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了json VS Code Chrome调试器 - 如何配置相关的知识,希望对你有一定的参考价值。

{
    // 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": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "WORKING -- Launch Chrome against localhost",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}",
            "sourceMaps": true,
            "port": 9229,
        },

        {
            "type": "node",
            "request": "launch",
            "name": "npm run dev",
            "port": 9222, // 9229
            "runtimeExecutable": "npm",
            "runtimeArgs": ["run", "dev"],
            "protocol": "inspector",
            "console": "integratedTerminal",
        },

        {
            "type": "node",
            "request": "launch",
            "name": "webpack-dev-server",
            "program": "${workspaceRoot}\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js",
            "cwd": "${workspaceFolder}",
            "sourceMaps": true,
            "trace": true
        },

        {
            "name": "Attach to url with files served from ./dist",
            "type": "chrome",
            "request": "attach",
            "port": 9222,
            "url": "<url of the open browser tab to connect to>",
            "webRoot": "${workspaceFolder}/dist"
        }
    ]
}

以上是关于json VS Code Chrome调试器 - 如何配置的主要内容,如果未能解决你的问题,请参考以下文章

VS Code + Chrome 调试 + nrwl 架构

Visual Studio Code-使用Chrome Debugging for VS Code调试JS

在 VS Code 中调试vue项目

debug-vuejs-from-vs-code:在 chrome 中调试 vueJS 应用程序时未绑定断点

无法在 TypeScript 中调试 - VS Code

VS Code 或 Chrome 开发工具:调试 NPM Workspaces (monorepo) TypeScript + React 代码