我正在尝试使用VSC开发基本的angular2应用程序。代码是用TypeScript编写的。这是一个基本的todo应用程序,所有的代码(.ts,js,.js.map)都在应用程序/子文件夹中。在Visual Studio中调试Angular2应用程序代码
这是运行我launch.json配置:
{
"name": "Run",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/lite-server/bin/lite-server",
"stopOnEntry": false,
"args": [],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": false,
"outDir": null
},
当我运行它,应用程序加载在Chrome,但没有我的断点的工作。当我悬停一个断点时,我看到“断点被忽略,因为找不到生成的代码(源图问题?)”。
我在/app/todo.component.ts中有一个断点。在我/app/todo.component.js.map我可以看到:
"file":"todo.component.js","sourceRoot":"/Users/xxx/Documents/webs/angular2-todo/app/","sources":["todo.component.ts"],"names":[],"mappings":";;;;;;;;;;
来源的根和源似乎挺合我意。
任何想法?
如果你想使用Chrome扩展,则是指此调试 - http://stackoverflow.com/questions/36494938/debug-run-angular2-typescript-with-visual-studio-code?rq=1 – Sanket
它是否需要扩展chrome? – Chux
是的......如果你想使用镀铬 – Sanket