从Visual Studio 2017部署Angular 2应用程序 [英] Deploying an Angular 2 application from Visual Studio 2017

查看:103
本文介绍了从Visual Studio 2017部署Angular 2应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Studio 2017并开发了两个Angular 2应用程序.第一个是没有后端代码的纯Angular 2(数据来自wcf服务).第二个是托管在MVC应用程序(.net 4.6)中的Angular 2 SPA应用程序.它们都很好用,我可以毫无问题地在VS2017中运行和编辑它们.问题在于部署到IIS服务器.目前,我正在使用gulp将node_modules目录中的组件捆绑到.js文件中.然后,我将手动将应用程序的所有文件(包括gulp捆绑文件)复制到服务器.这是一个费力的过程,我想找到一个更好的方法.我希望Visual Studio提供模板来创建上述两种类型的angular 2应用程序,并希望发布该功能以捆绑该应用程序,包括单击按钮即可包含必需的node_module组件,但我对此感到失望.我尽可能接近此功能的最佳选择是什么?请帮忙.

I use Visual Studio 2017 and have developed two Angular 2 applications. The first is pure Angular 2 with no backend code (Data comes from wcf services). The second is an Angular 2 SPA application hosted in an MVC application (.net 4.6). They both work great and I can run and edit them in VS2017 with no issues. The problem comes with deploying to an IIS server. At the moment, I am bundling the components from the node_modules directory into .js files using gulp. I am then manually copying all the files for the application (including the gulp bundled files) to a server. This is a laborious process and I would like to find a better way. I was hoping Visual Studio would have provided templates to create the two type of angular 2 applications described above and also publish functionality to bundle the app including the necessary node_module components at the click of a button but have been disappointed. What is my best option to get as close to this functionality as possible? Please help.

推荐答案

感谢大家的宝贵建议.通过设法在这里找到出色的文章,我设法实现了这一目标: http://candordeveloper .com/2017/04/12/how-to-use-angular-cli-with-visual-studio-2017/

Thanks to everyone for the great suggestions. I've managed to achieve this by following the excellent article I found here: http://candordeveloper.com/2017/04/12/how-to-use-angular-cli-with-visual-studio-2017/

本文非常简单明了,并且运行良好.希望这对其他人也有帮助.

This article made it pretty straight-forward and it is working well. Hopefully this helps others as well.

这篇关于从Visual Studio 2017部署Angular 2应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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