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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With