At this address, you will find that the current TypeScript preview version does not provide a project template for an ASP.NET MVC 4 project. But you can edit the csproject file with the following code:
<ItemGroup> <TypeScriptCompile Include="$(ProjectDir)\**\*.ts" /> </ItemGroup> <Target Name="BeforeBuild"> <Exec Command="&quot;$(PROGRAMFILES)\ Microsoft SDKs\TypeScript\0.8.0.0\tsc&quot; @(TypeScriptCompile ->'"%(fullpath)"', ' ')" /> </Target>
It allows you to compile all TypeScript when creating an ASP.NET MVC 4 project.
About optimization:
I suggest that you separate the JavaScript files of your project and add links to their home page, for example, to this post: How can I automatically compress and minimize JavaScript files in an ASP.NET MVC application? .
You can also use bundling with a Razor view. Personally, I use this and it works great.
Francois borgies
source share