升级到 Visual Studio 2015 后,“保存时编译”功能对我不起作用。当我对 .ts
进行更改时在我的项目中保存文件,IDE 底部的状态栏显示 Output(s) generated successfully
, 但生成的 .js
文件没有改变。
这是我尝试过的:
将以下内容添加到根
<Project>
我的元素.csproj
:<PropertyGroup> <TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled> </PropertyGroup>
选中和取消选中
Tools -> Options -> TypeScript -> Project
中的“自动编译不属于项目的 TypeScript 文件”选项:仔细检查以确保在我的项目的 TypeScript 构建属性中选中“保存时编译”:
我错过了什么?
作为旁注,TypeScript 编译步骤在由常规构建触发时确实按预期工作。
最佳答案
对我来说,这是 tsconfig.json
中的这个选项:
"compileOnSave": true,
"compilerOptions": { ... },
重新启动 Visual Studio 以使此更改生效。
关于javascript - TypeScript "Compile on save"功能在 Visual Studio 2015 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31750964/