6

I'm trying to include TypeScript files in my automatic git deploy so I can showcase code for a framework I'm building. However, whenever I deploy to azurewebsites the deployments do not include the TypeScript files.

Site in question: http://endgate-samples.azurewebsites.net/Samples/AnimatedSprites/

What I've tried:

  1. Copy all TypeScript files to output folder by setting TypeScript properties to "Copy Always". Issue with this is that I need to change the references to all the files (do not want to do this).

  2. MSBuild pipeline. This works for file system deploy but not web deploy... https://github.com/NTaylorMullen/EndGate/blob/master/EndGate/samples/EndGate.Core.JS.Samples/EndGate.Core.JS.Samples.csproj#L896-L909.

  3. Manual publish to FTP endpoint (works like a charm), but not automatic. Also requires the msbuild pipeline (#2)

What am I doing wrong or what can I do (that I haven't tried) to get my TypeScript files deploying automagically?

5
  • Really like the # link to file lines. Didn't know you could do that. Manually modified the url? Commented May 17, 2013 at 5:00
  • 1
    Nope, just gota click start line, hold shift then click end line Commented May 17, 2013 at 5:18
  • sweet tip. Thanks mate. Commented May 17, 2013 at 5:23
  • Would this work for now - github.com/projectkudu/kudu/issues/556? Commented May 17, 2013 at 22:19
  • Sadly no, that will build the typescript files and gather the outputted JS files to deploy but it will not include the original .ts files. I've got my generated JS deploying but the TS files are just ignored entirely, even with all my extra work arounds. Commented May 18, 2013 at 2:33

1 Answer 1

5

So after a lot of work it turns out that with the msbuild pipeline piece (#2) it will actually deploy the typescript files. One thing that I was missing was adding the appropriate mime type to handle typescript files.

It turns out by default IIS won't serve the TypeScript files correctly.

To add the Custom mime type I did:

<system.webServer>
    <staticContent>
      <remove fileExtension=".ts"/>
      <mimeMap fileExtension=".ts" mimeType="text/plain" />
    </staticContent>
</system.webServer>

It's important that we remove the existing .ts mime type (if there is one) prior to adding the mime type. If you deploy onto a machine that has the .ts mime type already and you do not remove prior to adding, it will pretty much destroy your existing mappings and will fail to serve any css, js files etc.

This has been a battle but I finally got it working, hope this helps somebody else in the future!

Sign up to request clarification or add additional context in comments.

2 Comments

+1 Epic work on the library mate : endgate-samples.azurewebsites.net Starred : github.com/NTaylorMullen/EndGate
Haha thanks @BASarat, it's still in the works but should be done soon!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.