📜  如何将 typescript 编译为 javascript es6 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:21.933000             🧑  作者: Mango

代码示例1
Run $tsc —init (in the folder containing the typescript file to compile)
(this creates a tsconfig.json file which has a bunch of json settings)
Navigate to tsconfig.json
 and 
Change from “target”: “es5”  to “target”: “es6”
Recompile the typescript file by tsc index and the index.js file will have es