简体   繁体   中英

Visual Studio 2017 not compiling typescript

I recently updated to VS 2017 and I'm using a solution that used to work perfectly in VS 2015. I have enabled the "Compile on save" function in Tools > Text editor > TS/JS > Project and I'm sure I'm using the correct "code generation" option, but VS won't compile any typescript file.
The js output file already exist, it was generated by VS 2015, and when I save the ts file the bottom bar shows the "Output(s) generated successfully" message but there is no change in the js file.
Note that the project is under source control, but both ts and js files are checked out for edit.
I read online that similar issues were been resolved with lastes VS updates, and I'm sure my version of VS is up to date.
Does anyone know what's going on?

Check ts file properties in Solution explorer. If Build action = Content , change it to TypeScript file

在此输入图像描述

in a .NET Core 2.1 project in which I has used VS's New Project template for React, I had to edit the .csproj and change <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> to false .

Why does this option even exist!?!?!

通过安装gulp解决并在必要时手动编译TypeScript。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM