简体   繁体   English

如何在ASP.NET Core 1.0中删除Bower并将npm用于客户端?

[英]How can I drop bower and use npm for client-side in ASP.NET Core 1.0?

I want to directly use npm to install jquery , bootstrap ... and remove bower from my project. 我想直接使用npm安装jquerybootstrap ...并从项目中删除bower。

What do I have to do for this to work? 我必须做什么才能使其正常工作?

Remove the following two files from your project directory to prevent any dependency on bower packages. 从项目目录中删除以下两个文件,以防止对Bower程序包的任何依赖。 Visual Studio should empty out the wwwroot/lib folder (make sure this happened, otherwise remove manually). Visual Studio应该清空wwwroot/lib文件夹(确保发生这种情况,否则请手动删除)。

.bowerrc    
bower.json

To use NPM modules you'll have to setup something like a gulp pipeline. 要使用NPM模块,您必须设置类似gulp管道的内容。 This enables you to pick and choose, and combine it all. 这使您可以选择和组合所有内容。 The built in bower integration has the (questionable) advantage of being in your wwwroot . 内置的Bower集成具有置身于wwwroot的(无疑)优势。

This should get you started: http://www.mikesdotnetting.com/article/283/asp-net-5-managing-client-side-dependencies-with-npm-bower-and-gulp (use a different location for the modules. You can require the specific pieces you want for the javascript if you don't want to reference the direct file location in the node_modules . 这应该可以帮助您入门: http : //www.mikesdotnetting.com/article/283/asp-net-5-managing-client-side-dependencies-with-npm-bower-and-gulp (对于如果您不想引用node_modules的直接文件位置,则可以要求javascript所需的特定部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在ASP.NET MVC项目中为knockout生成客户端视图模型? - How can I generate client-side view models for knockout in an ASP.NET MVC project? 自定义客户端验证未在 ASP.NET 内核中触发 - Custom Client-Side Validation not triggering in ASP.NET Core 如何在 ASP.NET Core 3.1 MVC 中进行RequiredIf 客户端和服务器端验证? - How to make RequiredIf Client-side and server-side validation in ASP.NET Core 3.1 MVC? 如何在ASP.NET Core 2.0中的自定义验证属性中进行客户端验证? - How To Do Client-Side Validation In Custom Validation Attribute In ASP.NET Core 2.0? 如何使用 ASP.NET Core 更改输入字段的客户端验证错误 CSS 类? - How to alter the client-side validation error CSS class of an input field using ASP.NET Core? ASP.NET Core-如果不存在用于选择文件的客户端UI,如何上传zip文件 - ASP.NET Core - How to upload a zip file if there does not exist a client-side UI for file selection 如何使用客户端验证来处理 c# 中的 asp.net mvc? - How to use client-side validation to work on your asp.net mvc in c#? 结合 Asp.Net Core 服务器端和 React 客户端 - Combining Asp.Net Core server-side and React client-side 用于客户端和服务器端验证的 ASP.NET Core 重用代码 - ASP.NET Core Reuse Code for Client-Side and Server-Side Validation 如何在 ASP.NET Core 中使用 npm - How to use npm with ASP.NET Core
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM