6
我正在嘗試使用VS Code Chrome調試器來調試Angular2(2.0.0-beta.9)& Typescript(v1.8.7)。我正在ts文件中設置斷點,但調試器正在顯示js。調試器在整個應用程序位於一個文件夾中時顯示ts,但在應用程序由子文件夾組成時不能正確顯示。起初我以爲它不能解決映射,但我打開了診斷程序,可以看到路徑正在被正確解析。VSCode Chrome調試器不停止在Typescript文件中
下面是來自診斷窗口的一個示例:
›Paths.scriptParsed: resolved http://localhost:3000/bin/hero/hero.service.js to c:\MyDev\ng2\bin\hero\hero.service.js. webRoot: c:\MyDev\ng2
›SourceMaps.createSourceMap: Reading local sourcemap file from c:\MyDev\ng2\bin\hero\hero.service.js.map
›SourceMap: creating SM for c:\MyDev\ng2\bin\app.component.js
›SourceMap: no sourceRoot specified, using script dirname: c:\MyDev\ng2\bin
›SourceMaps.scriptParsed: c:\MyDev\ng2\bin\app.component.js was just loaded and has mapped sources: ["c:\\MyDev\\ng2\\app\\app.component.ts"]
›SourceMaps.scriptParsed: Resolving pending breakpoints for c:\MyDev\ng2\app\app.component.ts
tsconfig.json:
{
"name": "Launch localhost with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000/index.html",
"sourceMaps": true,
"webRoot": "${workspaceRoot}",
"diagnosticLogging": true
}