javascript - TypeScript "Compile on save"功能在 Visual Studio 2015 中不起作用

标签 javascript visual-studio compilation typescript visual-studio-2015

升级到 Visual Studio 2015 后,“保存时编译”功能对我不起作用。当我对 .ts 进行更改时在我的项目中保存文件,IDE 底部的状态栏显示 Output(s) generated successfully , 但生成的 .js文件没有改变。

这是我尝试过的:

  • 将以下内容添加到根 <Project>我的元素 .csproj :

    <PropertyGroup>
        <TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled>
    </PropertyGroup>
    
  • 选中和取消选中 Tools -> Options -> TypeScript -> Project 中的“自动编译不属于项目的 TypeScript 文件”选项:

    enter image description here

  • 仔细检查以确保在我的项目的 TypeScript 构建属性中选中“保存时编译”:

    enter image description here

我错过了什么?

作为旁注,TypeScript 编译步骤在由常规构建触发时确实按预期工作。

最佳答案

对我来说,这是 tsconfig.json 中的这个选项:

"compileOnSave": true,
"compilerOptions": { ... },

重新启动 Visual Studio 以使此更改生效。

关于javascript - TypeScript "Compile on save"功能在 Visual Studio 2015 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31750964/

相关文章:

javascript - 使用 angularjs 1.4 提交验证不起作用

c++ - MinGW/GCC 延迟加载 DLL 等价物?

javascript - HTML5 拖放 - 如何删除 IE 上的默认重影图像

c++ - 我有 Visual Studio 错误调试断言失败

c# - C# 中的数据从 sdf 数据库中消失

c++ - 让 GLEW 在 Code::Blocks 中进行编译

c++ - 错误! constexpr 变量必须由常量表达式 constexpr 初始化

android - opengles 2.0 不编译 fragment 着色器代码

Javascript:网页中与脚本相关的 HTML 标签的不正确中和(基本 XSS)

javascript - 给定一个点和一个距离,计算 map 上的一个点