Visual Studio 2017 ASP.NET MVC核心模板中的Bower替换 [英] Bower replacement in Visual Studio 2017 ASP.NET MVC Core Template

查看:169
本文介绍了Visual Studio 2017 ASP.NET MVC核心模板中的Bower替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我使用Visual Studio 2017(15.6.3)从头创建了一个ASP.NET MVC Core项目.我发现了常用的JavaScript框架:

Lately I created a ASP.NET MVC Core project from scratch using Visual Studio 2017 (15.6.3). I discovered the usual JavaScript frameworks:

  • 引导程序
  • jquery
  • jquery-validation
  • jquery-validation-unobtrusive

但是不幸的是,所有Bower支持都消失了!不再有bower.json.bowerrc和管理Bower程序包...":

But unfortunately all Bower support is gone! There's no bower.json, no .bowerrc and no "Manage Bower Packages..." anymore:

Visual Studio的ASP.NET MVC Core模板怎么了?鲍尔过时了吗?

What's wrong with Visual Studio's ASP.NET MVC Core template? Did Bower become obsolete?

如果不赞成使用Bower,请不要将此问题复制到如何在Visual Studio 2017中使用Bower软件包!我不喜欢指向不推荐使用的技术的修复程序.

Please don't duplicate this question to How to use bower packages in Visual Studio 2017 if Bower is deprecated! I don't like a fix pointing to deprecated technologies.

我想缩小问题:用NPM替换Bower的最简单(最直观)方法是什么?像Bower的.bowerrc:{ "directory": "wwwroot/lib" }一样?

I'd like to narrow the question: What's the simplest (most intuitive) way to replace Bower by NPM? Like Bower did with its .bowerrc: { "directory": "wwwroot/lib" }?

推荐答案

鲍尔实际上已经死了.

Microsoft对此具有轻量级且目前处于雷达解决方案之下,称为

Microsoft have a lightweight and currently under the radar solution to this called Library Manager (LibMan).

这是一个基于json的简化解决方案,具有非常简单的UI-可让您控制要下载的文件(只需要1个文件就无需下载数百个文件).

It's a stripped down json based solution, with a very simple UI - that gives you control over which files to download (no more downloading hundreds of files when you just need 1).

Mads Kristensen对Build 2017的预览做了很多介绍. (视频应在43分钟左右的正确位置开始).

Mads Kristensen did a great little intro to the preview at Build 2017. (the video should start at the correct place around 43 mins).

在撰写本文时,它仍处于预览状态-但将与Visual Studio 15.8一起发布.

At the time of writing this it's still in preview - but due to be released with Visual Studio 15.8.

如果您想在此之前尝试一下,可以从 GitHub存储库 Visual Studio市场-

If you'd like to try it before that you can grab it from the GitHub Repo or Visual Studio Marketplace - instructions in the solution to this question

您仍然可以在Visual Studio市场中使用npm等-尽管这是Microsoft代替(或同时使用)npm的原因:

You can still use npm etc - though here are Microsoft's reasons for using this instead (or as well as) - from the Visual Studio Marketplace:

使用此扩展程序的原因

  • 对于当前未使用其他程序包管理器的应用程序
  • 对于您认为Bower和npm过大的项目
  • 对于不想使用Bower或npm的开发人员
  • 对于重视其工具简单性的开发人员
  • 用于使用自定义或私有软件包/文件
  • 对于NuGet无法安装内容包的ASP.NET Core应用程序
  • For apps not currently using another package manager
  • For projects where you think Bower and npm are overkill
  • For developers that don't want to use Bower or npm
  • For developers that values simplicity in their tools
  • For using custom or private packages/files
  • For ASP.NET Core apps where NuGet can't install content packages

这篇关于Visual Studio 2017 ASP.NET MVC核心模板中的Bower替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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