Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typescript compile on build not working

I have VS2015 and ASP.NET 5 RC1 project with some typescript files. Files are located in scripts folder and tsconfig is in this folder too. When I'm saving typescript file, js file is generated and everything is ok. But js files are not generated during build.

I have VS2013 installed also and some old projects using typescript, so may be there are some problems cause I have many TypeScript versions and many VS versions.

How can I troubleshoot compiling typescript during build? Build log says nothing about typescript. Checkbox 'Compile TypeScript on build' is project settings is enabled. In old ASP.NET projects TypeScript is enabled via custom target in csproj and it's easy to troubleshoot. But in xproj I don't see any typescript related things.

like image 655
VorobeY1326 Avatar asked Dec 04 '25 07:12

VorobeY1326


1 Answers

My current working solution is to add postbuild event which manually calls TypeScript compiler.

project.json:

"scripts": {
    "postbuild": ["tsc -p scripts\\tsconfig.json"]
}

(assumes you have tsc in your PATH variable)

like image 173
VorobeY1326 Avatar answered Dec 07 '25 09:12

VorobeY1326



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!