ant*_*rva 5 task typescript tsc tsd visual-studio-code
在 Visual Studio Code 中,我在 tsconfig.json 的代码中有以下代码
{
"version": "1.6.0",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"watch": true,
"experimentalAsyncFunctions": true,
"isolatedModules": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"preserveConstEnums": true,
"suppressImplicitAnyIndexErrors": true
},
...
}
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,该watch选项为 true。好吧,看起来这不足以将 .ts 文件编译为 .js,就像atom-typescript 那样。基本上,保存 .ts 时,新编译的 .js 应该与 .ts 文件位于同一目录中。
另外,我想避免在我的根项目中使用 gulp,因为我已经将 gulpfile.coffee 用于其他方式。有人有线索吗?
您必须在 .vscode 文件夹中定义一个tasks.json,如下所示:
{
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"showOutput": "silent",
"args": ["HelloWorld.ts"],
"problemMatcher": "$tsc"
}
Run Code Online (Sandbox Code Playgroud)
您可以在这里找到有关它的更多信息: https: //code.visualstudio.com/Docs/languages/typescript
| 归档时间: |
|
| 查看次数: |
2700 次 |
| 最近记录: |