Css 从bower依赖项中找不到字体系列src
我的项目中的所有javascript依赖项都由bower管理。我使用bower安装程序筛选出只需要的资源。其中之一是bootstrap,它包含一些字体,请参见bower配置:Css 从bower依赖项中找不到字体系列src,css,fonts,font-face,bower,bower-install,Css,Fonts,Font Face,Bower,Bower Install,我的项目中的所有javascript依赖项都由bower管理。我使用bower安装程序筛选出只需要的资源。其中之一是bootstrap,它包含一些字体,请参见bower配置: { ... "install":{ "path":{ "js":"public/js/lib", "map":"public/js/lib", "css":"public/css/lib", "l
{
...
"install":{
"path":{
"js":"public/js/lib",
"map":"public/js/lib",
"css":"public/css/lib",
"less":"public/less",
"eot":"public/fonts",
"svg":"public/fonts",
"ttf":"public/fonts",
"woff":"public/fonts"
},
...
"sources":{
"bootstrap":[
".components/bootstrap/dist/js/bootstrap.min.js",
".components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot",
".components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg",
".components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf",
".components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff",
".components/bootstrap/dist/css/bootstrap.min.css"
],
}
问题是,对于给定的配置,bower将所选字体资源放入以下目录:public/fonts/bootstrap/…
但是bootstrap.min.css
要求这些字体的位置如下:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
这将是public/css/lib/font/…
,因此返回404 not found。有没有办法在bower中覆盖这些路径,或者在应用程序css中覆盖字体定义