简体   繁体   中英

include typescript file in output result build with TFS

I want to have ts files in output result. when tfs build my project all ts file will compiled but just js files copy to drop folder or output. I need ts files in published web sites, but I could not copy them with TFS Build. I have seen this link How to include TypeScript files when publishing? but It dose not work for me. When I add each ts files as a content in csproject, that files copy to bin folder as a result. but it's hard to do for all type script files and I tjink it isn't good approch.

So after many work, I found the problem Actually this link work correctly: How to include TypeScript files when publishing? but in my csproject there is a strange thing, we have multi import tag and I found the order of theme must be as the following:

 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
 <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\$(MSBuildToolsVersion)\WebApplications\Microsoft.WebApplication.targets" Condition="false" />

In the other hands the Microsoft.CSharp.targets import tag MUST be the first to include type script files as content worked correctly.

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