Running and debugging TypeScript
Running a client-side TypeScript application
- Do one of the following:
- Choose on the main menu or press Alt+F2. Then select the desired browser from the pop-up menu.
- Hover your mouse pointer over the code to show the browser icons bar: Click the icon that indicates the desired browser.
To generate source maps during compilation
- Open the tsconfig.json file and make sure the sourceMap property is set to true.
To debug a TypeScript application running on an external web server
- Configure and set breakpoints in the TypeScript code.
- Run the application in the development mode. Often you need to run
npm startfor that. When the development server is ready, copy the URL address at which the application is running in the browser - you will need to specify this URL address in the run/debug configuration.
- Choose the newly created configuration in the Select run/debug configuration drop-down list on the toolbar and click . The URL address specified in the run configuration opens in the chosen browser and the Debug Tool Window appears.
- In the Debug tool window, proceed as usual: step through the program, stop and resume the program execution, examine it when suspended, view actual HTML DOM, etc.