webstrom软件
file =>settings=>tools=>file watchers
新建一个
name: TypeScript
program: C:\Users\Administrator\AppData\Roaming\npm\tsc.cmd
//找到npm的位置
arguments: --sourcemap --target "ES5"
output paths to refresh : $FileNameWithoutExtension$.js:$FileNameWithoutExtension$.js.map
working directory : $FileDir$
创建tsconfig.json
文件
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": true
},
"exclude": [
"node_modules"
]
}
创建index.ts
已经实时编译