简体   繁体   English

没有 NodeJS 的 Typescript 命令行编译

[英]Typescript command line compilation without NodeJS

I was looking over Typescript and was a bit confused about how you could build your js files from the ts files via the command line.我正在查看 Typescript,对如何通过命令行从 ts 文件构建 js 文件感到有些困惑。

It implies in the documentation that you can do it easily through nodeJS, which would be great if I wanted a dependency on nodeJS... So is there any way to compile it via the command line without having nodeJS or visual studio?它在文档中暗示您可以通过 nodeJS 轻松完成,如果我想要对 nodeJS 的依赖,那就太好了......那么有没有办法通过命令行编译它而无需 nodeJS 或 Visual Studio?

This may seem crazy to some, but I would just put a build script step to output the javascript at the end if possible then package it into my release, as I tend to do most of my javascript development with RubyMine and don't want a dependency on nodeJS or Visual Studio for my build server.这对某些人来说可能看起来很疯狂,但如果可能的话,我会在最后放置一个构建脚本步骤来输出 javascript,然后将其打包到我的版本中,因为我倾向于使用 RubyMine 进行大部分 javascript 开发并且不想要我的构建服务器依赖于 nodeJS 或 Visual Studio。

If you install the TypeScript Tools without Visual Studio installed on the machine, tsc.exe and its dependencies will still get installed.如果您在计算机上未安装 Visual Studio 的情况下安装TypeScript Tools ,则仍会安装 tsc.exe 及其依赖项。

You can also just xcopy deploy tsc.exe (I don't have a definitive list of its dependencies, but it's pretty straightforward to figure out, or just copy everything that gets installed to the SDK folder) to a build server.您也可以将 xcopy deploy tsc.exe(我没有其依赖项的明确列表,但很容易弄清楚,或者只是将安装到 SDK 文件夹的所有内容复制到构建服务器)到构建服务器。 The only thing unexpected you would need is msvcr110.dll, which you may or may not need to copy to tsc.exe's path.您唯一需要的是 msvcr110.dll,您可能需要也可能不需要将其复制到 tsc.exe 的路径。

The link in Ryan's answer is now heavily outdated and if you use it will generate a TS1005 error. Ryan 的答案中的链接现在已经严重过时,如果您使用它将生成 TS1005 错误。

Here's what you want https://www.microsoft.com/en-us/download/details.aspx?id=55258 and it is still put in the same Program files x86 / Microsoft SDKs directory, and for me at least was not added to my path.这就是你想要的https://www.microsoft.com/en-us/download/details.aspx?id=55258它仍然放在同一个 Program files x86 / Microsoft SDKs 目录中,至少对我来说不是添加到我的路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM