Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typescript not generating .js from TFS publish

I'll try to be as specific as possible.

We work with TFS and we use typescript for client-side scripts.

When we develop locally we can do everything perfectly normal but the problem comes whith the published websites from TFS.

The problem is that when we want to do a deploy, or if we want to automatize it, we need to do a workaround because under _PublishedWebsites typescript seems to not compile anything, and the scripts folder only contains the .ts files.

For now, the workaround is to go to the build folder and copy from there the .js files. This workaround works for now but I think the ideal scenario would be to have the .js files generated under the _PublishedWebsites folder.

We've tried different options but we couldn't find a solution yet, also the information found around is not very huge.

Any help would be appreciated.

Thanks.

EDIT: we are using VS 2013 and latest TFS and Typescript version. The ts files are added in a MVC project.

like image 297
Wallack Avatar asked Feb 12 '14 09:02

Wallack


1 Answers

I had the same problem and the following worked for me:

  1. Within Visual Studio right click on your project and unload it.
  2. Right click on the project again and edit the csproj.
  3. Make sure that the Typescript import comes directly after Microsoft.CSharp.targets.

Example:

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" />
like image 136
Memet Olsen Avatar answered Nov 04 '22 20:11

Memet Olsen