Stav Alfi
Stav Alfi

Reputation: 13923

How to debug on TypeScript code instead of JavaScript code in Chrome?

How to debug on TypeScript code instead 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.

Upvotes: 0

Views: 212

Answers (2)

hholtij
hholtij

Reputation: 2936

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

Upvotes: 1

Adrian Brand
Adrian Brand

Reputation: 21638

You need to have your transpiler generate .map files.

Upvotes: 5

Related Questions