Thursday 5 October 2017

Manually setup typescript project in VS 2015



.         1. Download -- Typescript Tools for Microsoft Visual Studio 2015

          2. Install Typescript Tools for Microsoft Visual Studio 2015 in your system.

       3. Create new Project of “HTML Application with Typescript”.




        4. Add folder structure as per below image in your project.

         5. Go to project property and apply configure settings as per following screen Typescript build settings.


           6. Collect your reference library files. There are two way

1.    Download

a.       All Typescript definition files download location is (make sure your browser is internet explorer) https://github.com/DefinitelyTyped/DefinitelyTyped/
b.      From this location download library.
c.       Find your definition file from 

OR

2.    Search
a.       Go to below search URL is (make sure your browser is internet explorer) https://github.com/DefinitelyTyped/DefinitelyTyped/find/master
b.      Type your file location like /types/react 
c.       Open file and get your code.



   
          7. Copy the reference library folder and create reference library folder under the @types folder.
       Copy the reference library files and paste to reference library folder under the @types folder.

        8. Open you reference library file and it must be sure to version of definition file (xxx.d.ts) with Typescript version.



.      9. Now build your project its working now.


Notes:

Error: “Cannot use imports, exports, or module augmentations when '--module' is 'none'”

Solution:

1 Open project properties (right click on your project in the Solution Explorer, and click "Properties").

2 Open the TypeScript tab.

3 Choose AMD in the module system section.