ts environment installation
partial installation
Download dependencies
npm install typescript
Enter the following command to generate the file tsconfig.json
npx tsc --init
Compilation command
npx tsc index.ts
Global installation
npm install -g typescript
Compilation command
tsc index.ts
frame
Basically, vue-cli and vite will have ts optional configuration when creating a project, and the official ones are very easy to understand.
First Experience
Create test.ts
let a:number = 1
Use the compile command
npx tsc test.ts
Then a test.js file will be generated, even if it is successful