包括蔚蓝的git的部署打字稿文件 [英] Include TypeScript files in azure git deploy

查看:237
本文介绍了包括蔚蓝的git的部署打字稿文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想包括我的混帐自动打字稿文件部署这样我就可以展示code为一个框架,我建设。但是,每当我部署到azurewebsites的部署不包括打字稿文件。

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.

在现场提问: http://endgate-samples.azurewebsites.net/Samples/AnimatedSprites /

我已经试过:


  1. 复制所有文件打字稿到输出文件夹通过设置打字稿属性设置为一直拷贝。问题与此是,我需要改变引用的所有文件(不希望这样做)。

  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).

MSBuild的管道。这适用于文件系统的部署而不是Web部署... <一个href=\"https://github.com/NTaylorMullen/EndGate/blob/master/EndGate/samples/EndGate.Core.JS.Samples/EndGate.Core.JS.Samples.csproj#L896-L909\" rel=\"nofollow\">https://github.com/NTaylorMullen/EndGate/blob/master/EndGate/samples/EndGate.Core.JS.Samples/EndGate.Core.JS.Samples.csproj#L896-L909.

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.

手册发布到FTP端点(就像一个魅力),但不是自动的。还要求管道的MSBuild(#2)

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?

推荐答案

所以经过了很多工作,事实证明,与管道的MSBuild件(#2),它实际上将部署打字稿文件。有一件事,我缺少的是添加相应的MIME类型来处理打字稿文件。

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.

原来,在默认情况下IIS将不会为打字稿正确的文件。

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

要添加自定义MIME类型我所做的:

To add the Custom mime type I did:

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

这是我们删除现有的.TS MIME类型(如果有的话)之前,将MIME类型是很重要的。如果部署到具有.TS已经MIME类型和你不前添加删除一台机器,它将pretty太多破坏你现有的映射,将无法服务于任何CSS,JS文件等。

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!

这篇关于包括蔚蓝的git的部署打字稿文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆