Stav Alfi
Stav Alfi

Reputation: 13923

VS 2015- typescript does not generate javascript files

I just installed VS 2015 Community. After building no js files are created inside the solution or the explorer.

Upvotes: 1

Views: 4141

Answers (3)

Stav Alfi
Stav Alfi

Reputation: 13923

I want to thanks all who tryied to help But the solution in cordova typescript project - The compiled .ts files are inside the www\scripts\appBundle.js.

*you may need to use @Micheal Braude solution to see the appBundle.js file.

thanks agian.

Upvotes: 1

Michael Braude
Michael Braude

Reputation: 6973

TypeScript is part of Community. The produced .js files aren't part of the project, so you won't see them unless you turn on 'show all files' from the solution explorer. Here is the button you need to press:

enter image description here

Then the .js files will appear after you build:

enter image description here

If you're not seeing these, then check to make sure you're using this project template:

enter image description here

Upvotes: 5

Oleh Dokuka
Oleh Dokuka

Reputation: 12184

I`m not sure that VS 2015 Enterprise works like Community version, but I tried to explain you, how to create Simple TypeScript project, and configure it for using step by step.

Steps

  1. Create new HTML Application, developed for TypeScript. When you have done it, you would get something like on image below: enter image description here It is a simple structure of application, here we have file app.ts, html view, and css style-sheet.

  2. Configure compilation - What you should to know about this step:

    • ES target version
    • Compile single merged file or separate files.

    Enter project configurations -->> Open TypeScripts Compilation tab -->> Choose required ES version in ComboBox -->> Write path to compiled file and it name, if needed (located slightly below).

  3. Add your first file to solution and write some code in it

  4. Create your file.

    4.1. If you prefer separate compilation then you should add dependency for your js file into html view. Usually, the *.js file compiled in the same location folder of *.ts file, that`s why targeting on you ts file when write dependency to js file

    4.2. If you prefer merged compilation, first that you need - it is configure order of file, it is very simple challenge: Add into the main file (in my case usually it is app.ts) and write in it list of your dependencies

    ///<reference path="path/to/file1.ts"/>
    ///<reference path="path/to/file2.ts"/>
    

    Than, you should replace in html view this default script path: with path to your final js file

  5. Test your application:

    • try to add some code that would help you to be ensure that your code works perfectly
    • run you application and ensure that it works as you expected.

Good Luck! I hope that this post helps you in your beginnings!!

P.S. Here working project.

Upvotes: 0

Related Questions