-
Install Visual Studio Code.
-
Create a directory for our project and change into it:
mkdir sample-typescript-application && cd sample-typescript-application
-
Install the TypeScript runtime. Just like the step of installing the Node.js runtime, this step is still necessary even though Visual Studio Code comes with support for the JavaScript and TypeScript languages. If we skip this step, the "TypeScript Watch" command that we'll use in one of the following steps will not work. To install the TypeScript runtime:
echo '{}' > package.json && npm install typescript --save-dev
-
Create a TypeScript file and save it with a
.ts
extension. -
Create a "tsconfig.json" file with the following content:
-
On Visual Studio Code:
-
Open Command Palette by pressing SHIFTCMDP.
-
Type "task" and select "Tasks: Run task".
-
From the "contributed" section, select the TypeScript folder.
-
Select "tsc: watch - tsconfig.json".
-
-
That's it! Now you can:
- Go to any TypeScript file in this folder.
- Place a breakpoint on any line of it by clicking on the area to the left of line numbers.
- Start debugging it by:
- Selecting the "Run and Debug" (or by pressing SHIFTCMDD).
- Clicking on the "Run and Debug" button.
Created
April 10, 2022 15:40
-
-
Save ugultopu/edbe1c95891538e3a7395597adff6087 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment