问题
The bower_components folder presented on ASP.NET 5 beta6 and earlier, but starting from beta7 bower_components folder doesn't exist anymore and bower packages located directly in the wwwroot/libs folder. And seems like this change breaks exportsOverride feature. Is it possible to reduce the amount of unnecessary files in the lib folder using exportOverrides or some other approach?
In bower.json I have the following exportsOverride section:
"exportsOverride": {
"bootstrap": {
"js": "dist/js/*.*",
"css": "dist/css/*.*",
"fonts": "dist/fonts/*.*"
}
}
in the wwwroot folder I expected to see the only files defined in the exportsOverride as it was in previous versions, but I see everything there:
回答1:
Hiya just to add my 2 pence here, I was following this post to the letter http://shellmonger.com/2015/02/28/adding-bootstrap-to-your-empty-asp-net-mvc6-project/ and it wasn't working for me, but the post failed to mention that you have to change the .bowerrc file to something like;
{ "directory": "bower_components" }
the default value is
{ "directory": "wwwroot/lib" }
回答2:
I've realized, that the issue is not in the ASP.NET or project template itself. The gulp task runner doesn't respect exportsOverride http://github.com/zont/gulp-bower/issues/30. The grunt can do it and gulp - not :(
来源:https://stackoverflow.com/questions/32678101/bower-exportsoverride-doesnt-work-on-asp-net-5-beta7