How to debug typescript in Ionic2

I use typescript in my Ionic 2 project. How to debug my typescript files? I try without a webpack file, but this is not a good solution for this! Can you help me?

+5
source share
4 answers

To debug your application, use the debugger keyword in your code to set a breakpoint

function myBrokenFunction() { debugger; // do other stuff } 

Read more about here for details.

+1
source

WebStorm / InteliJ Typescript debugging support . It uses the chrome extension and allows you to set breakpoints in the IDE. This blog post also covers it.

+1
source

If visual debugging is more than your style, you can check out Batarangle , Angular2 take the Batarang browser plugin.

0
source

If you use webpack as an application package, instead of collapsing, try creating a file in the root of the project, webpack.config.js, and write this content:

 module.exports = { devtool: 'source-map' } 

In the typescript configuration file tsconfig.json yuo should have an entry:

 "sourceMap": true 
0
source

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


All Articles