快速构建TS环境。
1、首先在全局安装node.js
2、在全局安装TS
npm install -g typescript
3、在VSCODE编辑器中新建TS文件夹
(1)通过命令行运行TS文件
tsc ./src/app.ts --outFile ./dist/app.js
tsc ./src/* --outDir ./dist --watch
(2)可以通过tsconfig.json配置文件运行
"outDir": "./dist",
"rootDir": "./src"
tsc --watch