4
votes

Background

I have just set up VS2013 with latest TypeScript support. Starting with the example "Greeter" app, I've built a simple one-page app. The TypeScript is all nicely rendered as .js on save. When I press F5 this builds and runs as expected.

Git

I've used the built-in Git support to sync to a new project on Visual Studio Online. All good so far.

Link Visual Studio Online to Azure with Git

Next, I set up a new (free) Azure Website in my Windows Azure account, and configured it for publishing from Git on Visual Studio Online. It created a build definition using the template named GitContinuousDeploymentTemplate.12.xaml. This needed a bit of fiddling to configure the "Windows Azure Deployment Environment" settings, particularly the "Webspace" which it turns out is "northeuropewebspace" for me. But, on my third attempt, the hosted build succeeded and deployed to my Windows Azure website.

Problem

The deployed site has no .js files, which were compiled from the TypeScript.

I can see from the build log that the TypeScript compiler was invoked:

CompileTypeScript:
  C:\Program Files (x86)\Microsoft SDKs\TypeScript\tsc.exe  --module AMD --sourcemap --target ES5 "CrankView.ts" "CrankViewModel.ts" "Point.ts" "scripts\DefinitelyTyped\jquery\jquery.d.ts" "StirlingApp.ts" "StirlingModel.ts" "WorldView.ts"

I received a warning that there were no .cs files, which is true:

CSC : warning CS2008: No source files specified [C:\a\src\Stirling\Stirling.csproj]

But then none of the .js files presumably created earlier appear in any of the subsequent build steps, and they don't appear on the deployment website.

Question

What do I have to do to get it to deploy the "compiled" .js files?

1

1 Answers

4
votes

You need to include the generated .js files into your Visual Studio Project for them to get deployed.

Update You can add all the js/ts files from a folder into visual studio using the following config, but if you do this you need to be careful not to "add a new file" and then commit the changes in the .csproj, since Visual studio tends to override this and reinclude every file manually :

<Content Include="Client\src\**\*.*">
</Content>