如何在Visual Studio 2015中设置TypeScript环境 [英] How to setup TypeScript environment in Visual Studio 2015

查看:117
本文介绍了如何在Visual Studio 2015中设置TypeScript环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用社区版Visual Studio2015.我想设置环境以在Type.net Webforms应用程序中使用TypeScript.我在使用Visual Studio Code时会看到很多指导,但在Visual Studio中却没有.我正在遵循

I am using the community edition Visual Studio 2015. I want to setup the environment to use TypeScript to be used in an asp.net webforms application. I see lots of guidance in doing it using Visual Studio Code but not in Visual Studio. I was following the methods given at http://mobilemancer.com/2015/08/14/getting-started-typescript-1-5-in-visual-studio-2015/ However I don't see the option for NPM Configuration file under DNX. I see it only under C#, so probably it is server side while DNX represents client side. I have installed Visual Studio 2015 Update 3 as well as .Net Core 1.0

谢谢

推荐答案

实际上非常简单:

  1. 从工具中安装TypeScript->扩展和更新
  2. 在Web表单项目的根目录中添加tsconfig.json.请参阅链接,以获取有关TypeScript配置文件的更多信息./li>
  3. 将TypeScript文件(* .ts)添加到您的应用程序
  4. 在页面中添加指向已转译的JavaScript文件的链接.您可以在tsconfig.json文件中定义JavaScript文件的创建位置.
  1. Install TypeScript from Tools -> Extension and Updates
  2. Add tsconfig.json at the root of the web form project. Refer to this link for more info on the TypeScript configuration file.
  3. Add TypeScript file (*.ts) to your application
  4. Add link to the transpiled JavaScript file in your page. You can define where the JavaScript file is created in the tsconfig.json file.

如果您需要使用NPM,那么您的原始参考链接就可以正常工作.

If you need to use NPM, then your original reference link works just fine.

这篇关于如何在Visual Studio 2015中设置TypeScript环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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