【发布时间】:2016-10-30 06:33:18
【问题描述】:
我正在运行最新的 1.2 版本的 vscode 和 1.8 的 typescript。我已经尝试了我能想到的所有可能的 launch.json 组合,类型为“node”和“chrome”,但我还没有找到一个组合来填充 vscode 本身的任何字段。我主要是让程序启动,但在 vscode 本身内没有进行调试。我想知道是否有人有在 vscode 中调试打字稿电子程序的工作示例?还是不可能?
任何帮助将不胜感激!
更新
我现在在 vscode 中有控制台,提供电子的调试输出 - 但仍然没有变量或其他输出 - 这是我当前的 launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "chrome",
"request": "launch",
// "program": "${workspaceRoot}/src/main.ts",
// "program": "${workspaceRoot}/bin/main.js",
// "stopOnEntry": false,
// "args": [],
// "cwd": "${workspaceRoot}",
"sourceMaps": true,
// "preLaunchTask": "build",
// "externalConsole": false,
// "outDir": "${workspaceRoot}/bin",
"runtimeExecutable": "${workspaceRoot}/node_modules/electron-prebuilt/dist/electron.exe",
//"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd",
// Optional arguments passed to the runtime executable.
"runtimeArgs": [
// "--enable-logging",
// "--nolazy",
"--remote-debugging-port=9222",
"--host-rules='MAP * 127.0.0.1'",
"${workspaceRoot}"
// ],
]
// Environment variables passed to the program.
// "env": {
// "NODE_ENV": "development"
// }
}
}
【问题讨论】:
标签: typescript visual-studio-code electron