Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

typescript - Type Script is not generating JavaScript in my Visual Studio Community edition 2015

I am using Visual Studio Community edition 2015 for development, I have added *.ts file to my project but its not automatically compiling. Also it does not show JavaScript preview pane. This post How do I enable the preview panel for TypeScript files in Visual Studio 2015? says that it's not supported anymore. That's fine, but why it's not compiling?

I referenced Missing Typescript Options in Web Essential for Visual Studio 2012

It says Split panes have been reintroduced in the latest version of web essentials http://vswebessentials.com/features/typescript but I can not see it

I do have typescript exe in following folder

   C:Program Files (x86)Microsoft SDKsTypeScript1.5

I do have settings in Project Properties as follow

enter image description here

I do have settings as follow in Visual Studio

enter image description here

I see comment in http://www.typescriptlang.org/ as below

"Visual Studio includes TypeScript in the box, starting with Visual Studio 2013 Update 2. You can also edit TypeScript in VS Code, WebStorm, Atom, Sublime Text, and Eclipse"

What may be issue?

Solution

My "typings" file for jquery was out dated, I upgraded it and it resolved other errors and build was success, then JS files got generated.

Below post helped JQuery definition screwed up with TypeScript 0.9

I can not close this question because I am still not able to get 'Preview Pane"

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I regularly encounter this issue in VS 2015 and VS 2013. My solution is not a pretty one, but it works for me...

  1. Close Visual Studio
  2. Go to your scripts folder, delete all JavaScript files that have corresponding TypeScript files (only necessary to do this for TypeScript files that you have created for your project)
  3. Open Visual Studio, clean, and build

If this doesn't work, open each TypeScript file, change one character, Save, re-build... hopefully the file will re-compile.

If this still doesn't work, open a Node.JS command prompt, change directory to the scripts directory, run;

tsc "yourfile.ts"

If this doesn't work, you've got bigger problems.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...