0

I very new to TypeScript. What is the right way of using TypeScript in Visual Studio 2013 update 3? Firstly i installed TypeScript for Visual Studio 2013. But i did not get anything. When i uninstalled TypeScript for Visual Studio 2013 extension and installed web essentials for VS 2013 update 3. I actually got type script support but only when i make new project. For existing project made with VS 2013 too i can not get compile on save. I checked Tools-> options-> Text editor-> TypeScript > Project to Enable Automatic compiling, but in this section VS tells me that some error occurs during loading. Recently i figured out that VS 2013 should have typescript support out of box. Is this mean that i don`t need Web Essentials? I just want to get compiling on save for VS 2013 what should i do?

1
  • Are you adding typescript files? with a .ts extension? Do that and hit save on the file. 2 files should be created (.js + .js.map). With Web essentials installed go to --> Tools -> Options -> Web essentials -> Run on save (set this to true) Commented Oct 13, 2014 at 13:26

1 Answer 1

1

To convert existing web project to Typescript aware and get Typescript Build tab in project properties you will need to add a bunch of stuff into your project file via text editor.

  1. Add the following element at the top of Project element:
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
  1. Add the following to conditionless PropertyGroup element
<TypeScriptToolsVersion>1.4</TypeScriptToolsVersion>

or 1.1 if I remember correctly previous version in case you have not 1.4 installed

  1. Final nugget should go to the bottom of Project lemenet
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />

This helped me once, but perhaps those instructions are too cumbersome and it will be easier to create new Typescript project and see what is in there related to Typescript

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.