什么是TypeScript的MIME类型? [英] What's the MIME-Type of TypeScript?

查看:154
本文介绍了什么是TypeScript的MIME类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的IIS正确显示.ts文件,TypeScript是否有任何MIME类型?文字/javascript或类似文字也可能有效,但是有相关规范吗?

I want my IIS to correctly display .ts files, is there any MIME-Type for TypeScript? text/javascript or similar may also work, but are there specifications for that?

我已经查找了语言规范,但我没有找到任何线索.

I already looked up the language specification but I didn't find any clue.

推荐答案

最好知道为什么服务TypeScript文件.

It would be good to know why you want to serve TypeScript files.

据我了解,TypeScript用于编译为Javascript,然后在浏览器中执行.当前,没有对TypeScript的本机支持(如果我输入错了,请纠正我).

As far as I understand, TypeScript is used to compile to Javascript, which is then executed in a browser. Currently, there is no native support for TypeScript (correct me if I'm wrong).

如果您仍然希望通过IIS提供.ts文件,则仍可以在与IIS Admin相关联的自定义mime类型中添加与.ts.该标准定义了前缀x.vnd.prs.以及vnd.前缀还列在标准化的mime类型 text/

If you still want to serve .ts files via IIS, you can still add a custom mime-type in IIS Admin associated with .ts. The standard defines the prefixes x., vnd. and prs., and the vnd. prefix is also listed in the standardized mime types text/ and application/.

因此,根据您的用法,您可以选择text/x.typescripttext/prs.typescript.

So, depending on your usage, you might choose text/x.typescript or text/prs.typescript.

这篇关于什么是TypeScript的MIME类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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