[英]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安装
jquery
, bootstrap
...并从项目中删除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.