简体   繁体   中英

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.

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. 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. Things that I've spotted so far:

Dependencies

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.

在此处输入图片说明

Task Runner

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 . I don't get this in a brand new solution, but it reads as though gulp isn't installed on my machine?

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.

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. Other tools you'll be using in Gulp should be added here as well. You can use a new ASP.NET 5 project as an example.

You may want to add a bower.json file as well. Bower components will be downloaded to a bower_components folder, which will be hidden by default in the old project system. Adding Bower.json from the New Item template will also add a .bowerrc file that moves the package download location to wwwroot/lib. Probably not what you want for the MVC project; you could change this to just lib instead, or delete the .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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM