如何使这个简单的 TypeScript + React 应用程序与 Visual Studio 2015 一起工作? [英] How to make this simple TypeScript + React app work with Visual Studio 2015?

查看:24
本文介绍了如何使这个简单的 TypeScript + React 应用程序与 Visual Studio 2015 一起工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在四处寻找使用 Visual Studio 2015 工具链的 TypeScript + React 应用程序示例后,我决定尝试自己制作一个简单的示例项目,准备从 github 中查看、构建和运行.

After looking around for examples of TypeScript + React apps using the Visual Studio 2015 tool chain, I decided to try and make a simple example project myself, ready to check out from github, build and run.

然而,在花了几个小时试图完成这项工作后,我似乎没有得到它.这是公共存储库:https://bitbucket.org/KoenT_IM/typescriptreacttests.git

However, after spending several hours trying to make this work, I don't seem to get it going. Here is the public repository: https://bitbucket.org/KoenT_IM/typescriptreacttests.git

有人可以告诉我如何使用 Visual Studio 2015 构建和运行这个项目吗?谢谢!

Could someone show me how to make this project build and run using Visual Studio 2015? Thanks!

注意:我只对 Web 客户端应用程序(前端)的设置感兴趣.我们实际项目的服务器是用 C#/.NET(单独的项目)构建的.两者之间的通信将使用 websockets 完成.

Note: I'm only interested in a setup for a web client app (front-end). The server for our actual project is built in C#/.NET (separate project). Communication between the two will be done using websockets.

推荐答案

好的,经过一些更多的测试和尝试,我得到了一个基本的例子.

OK, after some more testing and trying, I got a basic example working.

它使用的是当前最新的稳定版 React(0.14.6,所以 react 和 react-dom 被分离了)、AMD 模块加载系统(使用 require.js)和 VisualStudio 2015 CE,你可以在那里调试在 IDE 中(使用 Internet Explorer 时).我从 Visual Studio 中的HTML Application with TypeScript"项目模板开始.它仍然在我之前发布的 GitHub 上的存储库中:https://bitbucket.org/KoenT_IM/typescriptreacttests

It's using the currently latest stable version of React (0.14.6, so where react and react-dom are split off), the AMD module loading system (using require.js), and VisualStudio 2015 CE, where you can debug in the IDE (when using Internet Explorer). I started from the "HTML Application with TypeScript" project template in Visual Studio. It's still in the repository on GitHub I posted earlier: https://bitbucket.org/KoenT_IM/typescriptreacttests

这篇关于如何使这个简单的 TypeScript + React 应用程序与 Visual Studio 2015 一起工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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