设定:
Mac:10.12.1
VsCode:1.8.1
Launch.json在
之下 {
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/.bin/babel-node",
"stopOnEntry": false,
"args": ["${workspaceRoot}/src/bin/www.js"],
"cwd": "${workspaceRoot}",
"preLaunchTask": "build",
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"console": "internalConsole",
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/dist"
]
}
Tasks.json位于
之下{
"version": "0.1.0",
"command": "npm",
"isShellCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"tasks": [
{
"taskName": "build",
"args": ["run","build"],
"isBuildCommand": true
}
]
}
当我启动调试器时,会话以下面的输出
开始node --debug-brk = 10048 --nolazy node_modules / .bin / babel-node ... / src / bin / www.js
侦听器侦听端口10048
一切看起来都不错,但我永远无法找到一个断点......我一定是想念一些傻瓜,感谢任何帮助。
谢谢!
答案 0 :(得分:0)
如果有人需要知道解决方案,以备将来参考。
"outFiles": [
"${workspaceRoot}/dist/*.js"
]
答案 1 :(得分:0)
如果使用打字稿,则应在tsconfig.json文件中添加 sourceMap 设置
tsconfig文件是用于从打字稿转换为javascript的配置文件