Debug & Run Angular2 Typescript with Visual Studio Code?
我正在try 用VS代码调试Angular2 typescript应用程序
任何人都可以分享调试和维护的步骤吗;从VS代码运行?
Debug & Run Angular2 Typescript with Visual Studio Code?
我正在try 用VS代码调试Angular2 typescript应用程序
任何人都可以分享调试和维护的步骤吗;从VS代码运行?
经过大量研究,我发现了以下步骤-
Before you begin, make sure you have latest version of VS code. You can verify latest version – Help > Check For Updates or About.
安装名为"Chrome调试器"的扩展.安装完成后,重新启动VS代码.
转到调试窗口,打开启动.使用Chrome的json.
emits 中.json配置部分,使用下面的配置
{
"name": "Launch localhost with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000/Welcome",
"sourceMaps": true,
"webRoot": "${workspaceRoot}"
}
在Tconfig.json,确保你有"sourceMap":true
这就完成了调试环境设置.
使用npm start命令和Chrome作为默认浏览器运行项目.
一旦应用程序成功运行,您将收到端口号.从chrome浏览器复制URL并粘贴到上面的URL部分.
现在,在typescript文件中的任何位置放置断点.
再次,进入VS代码中的调试窗口,点击Run.