VSCode,Electron,TypeScript,调试Renderer进程,设置skipfiles?

时间:2018-12-20 03:25:11

标签: typescript debugging visual-studio-code electron

我已经开始使用VS Code中的Typescript创建一个Electron应用程序。经过大量的重新配置后,除了用于渲染过程的skipfiles之外,我已经能够进行调试。

如何配置调试器以跳过不是我的代码的代码文件?

这是我当前的launch.json文件。

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Electron: Main",
        "type": "node",
        "request": "launch",
        "program": "${workspaceRoot}\\src\\main.ts",
        "stopOnEntry": false,
        "args": [],
        "cwd": "${workspaceRoot}",
        "runtimeExecutable": "${workspaceRoot}\\node_modules\\.bin\\electron.cmd",
        "runtimeArgs": [
            "--no-lazy",
            "--remote-debugging-port=9223"
        ],
        "env": {},
        "console": "internalConsole",
        "sourceMaps": true,
        "outFiles": [
            "${workspaceFolder}/dist/**/*.js"
        ],
        "skipFiles": [
            // this explains the skipFiles tag
            // https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_skipping-uninteresting-code-node-chrome
            "${workspaceFolder}/node_modules/**/*.js",
            "${workspaceFolder}/lib/**/*.js",
            "<node_internals>/**/*.js"
          ]
    },
    {
        "name": "Electron: Renderer",
        "type": "chrome",
        "request": "attach",
        "port": 9223,
        "webRoot": "${workspaceFolder}",
        "timeout": 30000,
        "skipFiles": [
            // this explains the skipFiles tag
            // https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_skipping-uninteresting-code-node-chrome
            "${workspaceFolder}/node_modules/**/*.js",
            "${workspaceFolder}/lib/**/*.js",
            "<node_internals>/**/*.js"
          ]
    }
],
"compounds": [
    {
        "name": "Electron: All",
        "configurations": [
            "Electron: Main",
            "Electron: Renderer"
        ]
    }
]
}

skipFiles用于主进程,但是在调试渲染器进程时,我仍然会得到随机代码。任何建议,将不胜感激。

0 个答案:

没有答案