Missing fonts/glyphicons-halflings-regular.woff in angular-animate
项目用到了bootstrap,于是用到了一个bootstrap一个图标。照常理说这个应该是没有问题的。但是项目运行后提示这个字体找不到。于是二话不说google之。于是看到一个大神的回复。
The less compilation happens in the browser when you're running the site with grunt serve so the default path for the fonts (../fonts/) is not relative to the bootstrap less files. To fix it just override the font path (in app.less by default)
@icon-font-path: "bower_components/bootstrap/fonts/";
Maybe something in angular-bootstrap started using glyphicons in 0.11 that's why you see this after upgrade.
本以为我也是这个问题,然后在app.less中修改了一下完全没有作用。
于是。。。便去搜索“fonts/glyphicons-halflings-regular.woff”,肯定在项目中有地方调用,然后看这个地方就行了。
结果。。。很不顺利。没有找到。于是便去定位gulp.js
找到了这么一行,原来这才是问题:
var vendor_fonts = [ 'bower_components/fontawesome/fonts/*', 'src/assets/fonts/**/*', ];
没有添加这fonts文件。于是添加解决之。
var vendor_fonts = [ 'bower_components/fontawesome/fonts/*', 'src/assets/fonts/**/*', 'bower_components/bootstrap/fonts/*' ];