私のプロジェクトのすべての JavaScript 依存関係は、bower によって管理されています。bower-installer を使用して、必要なリソースのみを除外します。それらの 1 つは、いくつかのフォントを含むブートストラップです。bower の構成を参照してください。
{
...
"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/fonts/...
、404 not found が返されます。これらのパスを bower でオーバーライドするか、アプリケーション css でフォント定義をオーバーライドする方法はありますか?