字体 - 真棒与自耕农发电机工作被推到Heroku的 [英] Font-awesome not working with yeoman generator pushed to Heroku

查看:134
本文介绍了字体 - 真棒与自耕农发电机工作被推到Heroku的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的约曼发电机角fullstack。随着新生成的角fullstack脚手架,我执行
凉亭安装--save组件 - 字体真棒然后添加在字体真棒图标main.html中的模板,建立和它推送到Heroku的,我看到了灰色框,其中的图标应该的。

I'm using the Yeoman generator "angular-fullstack". With a freshly generated "angular-fullstack" scaffold, I perform a bower install --save components-font-awesome then add in a font-awesome icon to the main.html template, build and push it up to heroku, and I see a grey box where the icon should be.

不过,如果我执行咕噜服务本地,我可以看到图标如我所料。

However, if I perform a grunt serve locally, I can see the icon as I expect.

我不知道这是一个约曼角fullstack问题,发出呼噜声,字体真棒发行或Heroku的问题,所以我把它扔在那里。也许有人可以帮助限制下来。

I don't know if this is a Yeoman Angular-fullstack issue, grunt issue, font-awesome issue or Heroku issue so I'm throwing it out there. Maybe someone can help limit this down.

注意:我使用组件 - 字体真棒,而不是字体真棒,因为咕噜不会建字体真棒正确因此有人建议使用垫片

Note: I'm using "components-font-awesome" instead of "font-awesome" because grunt won't build font-awesome correctly so it was advised to use the shim.

我看到了什么,当本地提供的:

What I see when served locally:

我看到的建成并被推到Heroku的时候:

What I see when built and pushed to heroku:

推荐答案

在这个版本自耕农角fullstack发生器,咕噜构建命令构建下的交付文件在 DIST 目录。其他计算器答案(即在上述意见中引用)暗示把字体真棒字体直属目录DIST 水平。然而,送达文件是在 DIST /公共。因此,它的根据其中字体目录中目前存在的公共目录和字体真棒字体文件应放置。

In this version of the Yeoman angular-fullstack generator, the grunt build command builds the delivered files under the dist directory. The other stackoverflow answer (that was referenced in the comments above) hinted to put the font-awesome fonts directory directly under the dist level. However, the served files are under dist/public. Therefore, it's under the public directory where the fonts directory currently exists and the font-awesome font files should be placed.

为了与现有的咕噜打造这部作品,我pre-复制的字体真棒字体文件到应用程序/字体目录。这样,咕噜构建自动将文件复制到 DIST /公/字体目录

To make this work with the existing grunt build, I pre-copied the font-awesome font files into the app/fonts directory. This way, the grunt build automatically copies the files into the dist/public/fonts directory.

这篇关于字体 - 真棒与自耕农发电机工作被推到Heroku的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆