How to compile Typescript files on VSTS build serv

2019-04-11 16:39发布

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.

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.

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

1条回答
小情绪 Triste *
2楼-- · 2019-04-11 17:12

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.

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

查看更多
登录 后发表回答