typescript - VSCode、Electron、TypeScript、调试渲染器进程、设置跳过文件?
问题描述
我已经开始在 VS Code 中使用 Typescript 创建一个 Electron 应用程序。经过大量重新配置后,除了渲染过程的跳过文件外,我已经能够进行调试。
如何配置调试器以跳过不是我的代码的代码文件?
这是我当前的 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 适用于主进程,但在调试渲染器进程时我仍然会出现随机代码。任何建议,将不胜感激。
解决方案
推荐阅读
- spring - 如何通过第三个链接两个表?
- highcharts - 如何将 yAxis 网格线扩展到 Highcharts 中的整个绘图区域?
- vuejs2 - 在 Vue 中将事件从嵌套的子级传递给父级
- javascript - 如何在 JSON 对象中添加多个值并获取更新的 json 文件
- javascript - Mixin 模式和原型构造函数
- http - POST 请求上的 Http 500 内部服务器错误
- angular - Angular + material sass:风格有时是错误的
- python - 如何循环 GET 直到收到某个响应
- complex-event-processing - 如何使用 EPL 在 Esper 中定义重叠的跳跃窗口?
- docker - 如何*安全地*设置 Jupyter-Notebook runnnig 启用 CUDA 的 PyTorch,在 docker 内,在互联网的专用服务器上?