如何使用“compileOnSave"在 VS 代码中? [英] How to use "compileOnSave" in VS Code?
问题描述
Typescript 有一个用于自动编译 typescript 的配置选项,如此处所述一>.
Typescript has a configuration option for auto compilation of typescript, as documented here.
{
"compileOnSave": true,
"compilerOptions": {
"noImplicitAny" : true
}
}
但仅仅将其包含在我的 tsconfig.json 文件中并不足以触发自动编译.我使用 MS Visual Studio Code 作为我的 IDE.如何触发保存时编译"行为?
But simply including this in my tsconfig.json file is not enough to trigger auto compilation. I use MS Visual Studio Code as my IDE. How do I trigger the "compile on save" behavior?
推荐答案
根据 TypeScript 网站:
此功能目前在 Visual Studio 2015 中受支持,带有 TypeScript 1.8.4 及更高版本,以及 atom-typescript 插件."
"This feature is currently supported in Visual Studio 2015 with TypeScript 1.8.4 and above, and atom-typescript plugin."
因此,目前 Visual Studio Code 不支持它.我在使用 Visual Studio 2015 和在家使用 Atom 时使用此选项,它工作正常.这实际上是我从 Visual Studio Code 切换到 Atom 的原因之一.
So, it isn't supported by Visual Studio Code at this time. I use this option at work with Visual Studio 2015 and at home with Atom and it works fine. This is actually one of the reasons I switched from Visual Studio Code to Atom.
这篇关于如何使用“compileOnSave"在 VS 代码中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!