How to debug typescript code in VS 2017?

I have an ASP.NET Core project that uses TypeScript.

Is it possible to debug TypeScript code in Visual Studio?

+6
source share
2 answers

In previous versions of Visual Studio, this was not possible.

However, this was fixed in Visual Studio 2017. Just set a breakpoint and run the project using IE (or Chrome), and your breakpoint will be deleted in your ts file and you can execute the code in the VS environment (not in the debug window of the browser code). This is a huge step forward for developing Typescript.

Interestingly, the code will switch to js if it jumps to another file for which there is no corresponding ts file, and then returns to ts again when possible.

+6
source

Make sure you turn on your browser link to see TS breakpoint hits. The parameter is the blue circle of arrows to the right of the browser selection drop-down list in VS2017, and it is disabled by default.

+3
source

Source: https://habr.com/ru/post/1012854/


All Articles