我正在嘗試使用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