gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 02:48:28 26 4
gpt4 key购买 nike

升级到 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com