Web Essentials 2017无法按预期使用TypeScript [英] Web Essentials 2017 not working as expected with TypeScript

查看:63
本文介绍了Web Essentials 2017无法按预期使用TypeScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已经下载了Visual Studio 2017社区,正在使用PluralSight上的一些TypeScript教程。


教程是使用VS2012&下载Web Essentials 2012.当他们安装这个&重新启动VS,当他们打开TypeScript文件&一个JavaScript文件自动弹出TypeScript文件&只要
对TS进行更改,JS就会更新。


但我唯一可用的版本是Web Essentials 2017(工具 - >扩展和更新 - >在线 - >搜索"网络"。


此外,当我安装并重启&打开TypeScript文件时,JS文件无法打开。


有谁知道为什么会这样?



非常感谢提前。

解决方案

嗨DaSweg,


欢迎来到MSDN论坛。


实际上,TS预览窗格已从Web Essentials 2015中删除,因为它与新版本
出来时的TS编译器。 并且我在VS 2017上找不到任何文件来确认它是否已被添加回来。另一方面,TS团队已经知道它,我希望他们将这个功能添加到TS工具中在将来。此功能
可能会包含在全新的Web编译器扩展中(并开始一个新问题,请问它。


希望我的回答会有所帮助。


Br



Hi,

I have downloaded Visual Studio 2017 Community and am working through some TypeScript tutorials on PluralSight.

The tutorial is using VS2012 & downloads Web Essentials 2012. When they install this & restart VS, when they open up the TypeScript file & a JavaScript file automatically pops up next to the TypeScript file & the JS updates whenever they make change to the TS.

But the only version available to me is Web Essentials 2017 (Tools -> Extensions and Update -> Online -> Search "Web".

Also, when I install & restart, & open the TypeScript file, the JS file does not open.

Does anyone know why this may be occurring?

Thanks a lot in advance.

解决方案

Hi DaSweg,

Welcome to the MSDN forum.

In fact, The TS preview pane has been removed from Web Essentials 2015 due to continuously running into conflicts with the TS compiler when new versions come out. and I don't find any documentation on VS 2017 to confirm if it has been added back. In other hand, The TS team are aware of it and I hope they will add the feature into the TS tooling in the future. It is possible that this feature will be included in the brand new Web Compiler extensions (https://visualstudiogallery.msdn.microsoft.com/3b329021-cd7a-4a01-86fc-714c2d05bb6c ) when preview panes have been implemented. More info: https://github.com/madskristensen/WebEssentials2015/issues/53 .

So far I will share you another way which is worth to try, could save the TS then JS will automatically update:

  • You need install all component of typescript from VS installer workload: run installer - choose Modify - then click Individual Components and under SDKs, Libraries and Frameworks you can add TypeScript.
  • Once installed you can add a tsconfig.json file to tell the TypeScript compiler how to behave, example here (The important setting is compileOnSave which tells VS to compile the js file when you save the ts.):

  • now see you have a nested Javascript file within your TypeScript file.

  • Now you just need to open both files side by side and when you save the ts then js will automatically update

In the meantime, our forum mainly is discussing with VS IDE issue, if you have any typescript version and complier issue, I recommend you redirect the Github forum and start a new issue to ask it kindly.

Hope my answer would be helpful.

Br

May


这篇关于Web Essentials 2017无法按预期使用TypeScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆