简体   繁体   中英

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.

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:

在此处输入图片说明

Then the .js files will appear after you build:

在此处输入图片说明

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

在此处输入图片说明

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.

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: 在此处输入图片说明 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!!

PS Here working project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM