【发布时间】:2017-06-17 08:21:58
【问题描述】:
我的 Electron 主进程是用 TypeScript 和捆绑的 Webpack 2 编写的。
转译是通过ts-loader 和babel-loader 完成的。
开发模式以webpack --watch 开头,main process configuration。
问题
我无法使用 VSCode 调试器调试主进程。
在入口点src/main/index.ts添加断点没有任何作用。
配置
.vscode/launch.js
{
"configurations": [
{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"runtimeArgs": [
"${workspaceRoot}",
"--remote-debugging-port=9222"
],
"sourceMaps": true
}
]
}
webpack.development.js
{
target: 'electron',
devtool: 'source-map',
entry: {
main: join(__dirname, 'src/main/index')
},
output: {
path: join(__dirname, 'app'),
filename: '[name].js'
}
}
【问题讨论】:
标签: debugging typescript webpack visual-studio-code electron