我使用 bower 安装“font-awesome”css 包。然后我将 bower 组件路径添加到我的 html 中:
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css(.) styles/vendor.css -->
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="bower_components/animate.css/animate.css" />
<link rel="stylesheet" href="bower_components/bootstrap-duallistbox/src/bootstrap-duallistbox.css" />
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css" />
<!-- endbower -->
<!-- endbuild -->
<!-- build:css(.tmp) styles/main.css -->
当我运行 grunt serve
时,超棒的字体样式表消失了!
我正在做一个由 yeoman 搭建的 angular 元素。
最佳答案
于是我找到了解决办法。当构建运行时,该 HTML 部分由 bower 和 grunt 自动填充。无论出于何种原因,font-awesome 不会填充该区域。相反,我使用了 components-font-awesome:bower install components-font-awesome --save
关于html - 当我运行 Grunt 时,它正在删除我的 CSS 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37011332/