2

All javascript depenedencies in my project are managed by bower. I use bower-installer to filter out only needed resources. One of them is bootstrap, which contains some fonts, see bower configuration:

{
    ...
    "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"
        ],
}

The problem is, with given configuration, bower puts selected fonts resources to following directory: public/fonts/bootstrap/... however bootstrap.min.css requires these fonts to be located as follows:

@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');
}

which would be public/css/lib/fonts/..., thus 404 not found are returned. Is there a way to override these paths in bower or override font definition in application css?

Mon Calamari
  • 4,403
  • 3
  • 26
  • 44

0 Answers0