如何在.Net Core 2项目的VSTS构建服务器上编译Typescript文件

编程入门 行业动态 更新时间:2024-10-25 04:18:25
本文介绍了如何在.Net Core 2项目的VSTS构建服务器上编译Typescript文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直试图在VSTS上的CI构建过程中将TypeScript文件编译为JavaScript文件.一旦生成了JavaScript文件,我的gulp文件进程就可以将它们处理到wwwroot文件夹中. 通过在更改时编译文件,然后在检测到的更改上运行gulp文件的Task Runner运行VS来遵循tsconfig.json文件,该项目可以在Visual Studio 2017中很好地构建.在Visual Studio中本地构建或发布时,会生成所有正确的文件.

I've been trying to get my TypeScript files compiled to JavaScript files in my CI build process on VSTS. Once the JavaScript files have been generated then my gulp file process can process them to the wwwroot folder. The project builds fine in Visual Studio 2017 with VS obeying the tsconfig.json file by compiling the file on change and then the Task Runner running the gulp file on detected changes and build. All the correct files are genereated when building or publishing locally in Visual Studio.

当尝试将VSTS中的构建过程设置为CI/CD过程的一部分时,将使用"dotnet.exe build"命令构建C#代码,该命令似乎无法编译TypeScript文件.

When trying to set up my build process in VSTS as part of my CI/CD process the C# code is built using the "dotnet.exe build" command which does not appear to compile the TypeScript files.

我如何让.Net Core 2项目同时构建在VSTS中编译和构建的C#和TypeScript文件?

How can I have the .Net Core 2 project build both the C# AND the TypeScript files compiled and built in VSTS?

推荐答案

默认情况下,dotnet build命令不会编译TypeScript文件.您可以安装 Microsoft.TypeScript.MSBuild 软件包,然后将通过dotnet build命令来编译TypeScript文件.

By default, dotnet build command won’t compile TypeScript file. You can install Microsoft.TypeScript.MSBuild package, then the TypeScript file will be compiled through dotnet build command.

另一方面,您也可以调用 tsc 命令来编译TypeScript文件.

On the other hand, you also can call tsc command to compile TypeScript file.

更多推荐

如何在.Net Core 2项目的VSTS构建服务器上编译Typescript文件

本文发布于:2023-11-13 23:46:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1585643.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:器上   文件   项目   如何在   Net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!