Friday 28 December 2012

Introducing TypeScript to existing project

What is TypeScript

You can read about it here: http://www.typescriptlang.org
In this article I will be focusing on how to run typescript as part of my existing solution (MVC3).
I am not going to use Nuget packages etc.

Installation

I should say that I am using Visual Studio 2012 Ultimate edition, but I have not found any options that will be related to Ultimate edition only.

I have downloaded add in for VS 2012 from http://www.typescriptlang.org/#Download

Also it is recommended that you install Web Essentials 2012

After installing both products you can run your type script files.


And here I am adding additional basic compile command.

I have found that I can generate definition files based on existing typescript file from


 tsc --declaration file.ts

How ever this does not work on js file that has been renamed into typescript.

Gotchas

  1. If your ts file does not parse(has lines under anything) it will also not compile and not work

Basic Guide TypeScript

No comments:

Post a Comment