Simon_Weaver
Simon_Weaver

Reputation: 146020

TFS build not building typescript files on server

I have set up typescript in Visual Studio to build a single file output.

However when I check my project into TFS and build it on the server this file is not created.

enter image description here

Upvotes: 3

Views: 2730

Answers (2)

Simon_Weaver
Simon_Weaver

Reputation: 146020

It turns out the settings are different for different configurations.

On the build server I am doing a Release build and the settings are per configuration.

So I just duplicated the settings and everything works fine now.

enter image description here

Upvotes: 6

masonk
masonk

Reputation: 9788

Possibly you're seeing it build on the client because of Build on Save, but it's not building on the server because you aren't importing the CompileTypeScript build target.

Navigate to your project in the Solution Explore, right click it, and Unload Project. Right click the unloaded project and select "Edit yourproject.csproj".

You need this line

  <Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" />

in the file after all of your TypeScriptCompile items are listed. I have mine as one of the last lines in the file.

This will cause the default action (usually Build) to actually compile your TypeScript.

Upvotes: 2

Related Questions