[英]Gulp + Bower support in VS2015 for an upgraded project
I'm basically trying to figure out what I need to do, to make an MVC project (created in Visual Studio 2013) to behave like a fresh MVC project created directly in Visual Studio 2015. 我基本上是想弄清楚我需要做什么,以使MVC项目(在Visual Studio 2013中创建)表现得像直接在Visual Studio 2015中创建的新MVC项目一样。
What I've noticed is that I see more interesting things in Visual Studio 2015 with a newly created project, and I'm sure some of these would be useful, but I can't figure out the magic to get them enabled. 我注意到的是,在一个新创建的项目中,我在Visual Studio 2015中看到了更多有趣的东西,并且我相信其中一些会有用,但是我无法弄清楚启用它们的魔力。 I've tried doing some googling but unfortunately keep finding tutorials for VS2013 support which isn't what I'm after, I specifically want to leverage the new VS2015 features. 我曾尝试进行一些谷歌搜索,但不幸的是,我一直在寻找关于VS2013支持的教程,这不是我想要的,我特别想利用VS2015的新功能。 Things that I've spotted so far: 到目前为止,我发现的事情:
How do I enable the dependency view? 如何启用依赖关系视图? I've tried copying a bower.json
file from a new project, but even after a restart in VS2015 I don't get this dependencies tracker. 我试图从一个新项目中复制bower.json
文件,但是即使在VS2015中重新启动后,我也没有得到此依赖项跟踪器。
How do I enable the task runner? 如何启用任务运行器? I tried creating a Gulpfile.js but I get an error in the output window gulp is not recognized as an internal or external command
. 我尝试创建Gulpfile.js,但是在输出窗口中出现错误gulp gulp is not recognized as an internal or external command
。 I don't get this in a brand new solution, but it reads as though gulp isn't installed on my machine? 我没有在全新的解决方案中获得此功能,但读取的内容似乎是我的计算机上未安装gulp?
How do I enable the dependency view? 如何启用依赖关系视图?
This isn't possible; 这是不可能的。 the Dependencies node is part of the DNX project system and is only available in new projects. Dependencies节点是DNX项目系统的一部分,并且仅在新项目中可用。
How do I enable the task runner? 如何启用任务运行器?
In addition to adding the gulpfile, you must add a package.json file, and add "gulp" to its devDependencies section. 除了添加gulpfile,还必须添加package.json文件,并将“ gulp”添加到其devDependencies部分。 Other tools you'll be using in Gulp should be added here as well. 您还将在Gulp中使用的其他工具也应添加到此处。 You can use a new ASP.NET 5 project as an example. 您可以使用一个新的ASP.NET 5项目作为示例。
You may want to add a bower.json file as well. 您可能还想添加一个bower.json文件。 Bower components will be downloaded to a bower_components folder, which will be hidden by default in the old project system. Bower组件将下载到bower_components文件夹,默认情况下,该文件夹在旧项目系统中处于隐藏状态。 Adding Bower.json from the New Item template will also add a .bowerrc file that moves the package download location to wwwroot/lib. 从New Item模板添加Bower.json还将添加一个.bowerrc文件,该文件将包下载位置移至wwwroot / lib。 Probably not what you want for the MVC project; 可能不是您想要的MVC项目; you could change this to just lib instead, or delete the .bowerrc. 您可以将其更改为lib或删除.bowerrc。 While the hidden bower_components folder is harder to work with, it's omitted from checkin in git, which is probably what you want. 尽管隐藏的bower_components文件夹较难使用,但在git的检入中将其省略了,这可能就是您想要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.