Recently I started experimenting with TypeScript, as we started using it at my day job and I wanted to use it for Resgrid. I really like the concept of what TypeScript is and what it brings to the table and for non-JS developers like myself. But recently I have not had a lot of luck getting TypeScript working in my projects.
This was using the latest version of TypeScript 0.9.1.1 and the latest version of WebEssentials (the one with TypeScript removed).
But I still couldn’t get JS files generated from the TypeScript files. No errors in the compiler and only a few warnings. Finally I found this blog post from almost a year ago.
I edited my MVC Apps’s web project file (.csproj) and added this BeforeBuild target:
<Target Name="BeforeBuild"> <Exec Command=""$(PROGRAMFILES)\Microsoft SDKs\TypeScript\tsc" @(TypeScriptCompile ->'"%(fullpath)"', ' ')" /> </Target>
So it’s still not generating on saving of the TypeScript file, but at least it is now generating them on a build.