Stav Alfi Stav Alfi - 5 months ago 34
Javascript Question

How to debug on typescript code insted of javascript code in chrome?

how to debug on typescript code insted of javascript code in chrome?
I only Found a way to do that manually every time from the start.
I write code in angular2 with webstorm 11.

Thanks all.

Answer

As Adrian said your transpiler needs to produce map info, which can also be generated into the js output file instead of a separate .map file.

One issue you may run into is that within lambda functions (aka arrow functions) you will not be able to see your variables, neither in chrome nor in WebStorm. However, there is a setting in WebStorm that allows you to see your this. variables properly within the WebStorm debugger:

Goto Help, Find Action, enter "registry". In the registry check js.debugger.map.this.by.source.code