Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug TypeScript compiler?

Tags:

typescript

Is there an easy way to step through TypeScript compiler (tsc.js) and observe how it works?

like image 732
Oleg Mihailik Avatar asked Nov 27 '12 22:11

Oleg Mihailik


People also ask

Can you debug TypeScript?

TypeScript is great for writing client-side code as well as Node. js applications and you can debug client-side source code with the built-in Edge and Chrome debugger.

How do I debug TypeScript in Chrome?

To debug TypeScript, we need to create an index. html and inside that we need to link our findbug. js file, this is because we will use the Chrome DevTools and we will be able to debug our TypeScript file. After that, we need to install live-server or use the live-server extension for VS Code.


1 Answers

One way is to use Windows Script Host with //x key. You need Visual Studio installed, and you can't use source maps to debug over the original source.

Another way is to debug it in Node.js using tools like Nodeclipse or similar.

The easiest way is to debug it using Developer Tools embedded in any modern browser. There is a web page emulating platform IO and allowing to run TSC over it: http://mihailik.github.com/tsc.browser/

like image 71
Oleg Mihailik Avatar answered Nov 14 '22 21:11

Oleg Mihailik