Font awesome URL not coded in main.css for grunt dist

佐手、 提交于 2019-12-22 12:32:25

问题


I used Yeoman to scaffold my project and Bower to install Font Awesome. I added

$fa-font-path: "../bower_components/font-awesome/fonts/";
@import "../bower_components/font-awesome/scss/font-awesome";

to app/styles/style.css

The fonts showed during development but not in the deployed stage where I used grunt dist to pack my files for deployment. I could see the font-awesome URLs in my dist/styles/59268e94.main.css were pointing to /bower_components/font-awesome/fonts/ whereas Bootsrap's glyphicons URLs were changed to a new location e.g. @font-face{font-family:'Glyphicons Halflings';src:url(../styles/fonts/2ad0632b.glyphicons-halflings-regular.eot). I think this could be the problem.

How can I get my web application to work with Font Awesome? Thanks.

Update #1 (26/3)

While waiting for a better answer and as to why Font Awesome SCSS fonts' URL were not changed like those in Bootstraps SCSS, I decided to remove "renaming the fonts files" task from Gruntfile.js as suggested by @bpaul in https://stackoverflow.com/a/21396651/185514

来源:https://stackoverflow.com/questions/22637984/font-awesome-url-not-coded-in-main-css-for-grunt-dist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!