gpt4 book ai didi

javascript - Grunt wiredep 没有注入(inject) font-awesome

转载 作者:可可西里 更新时间:2023-11-01 02:50:54 26 4
gpt4 key购买 nike

我目前正在从事一个已经开始使用 yeoman 的项目。

出于某种原因,当我运行 grunt-wiredep 时,除了 font-awesome 之外,所有依赖项都被正确地注入(inject)到我的 index.html 中。

这是我的 bower.json 文件:

{
"name": "watermelon",
"version": "0.0.0",
"dependencies": {
"angular": "^1.3.0",
"angular-animate": "^1.3.0",
"angular-bootstrap": "~0.13.3",
"angular-cookies": "^1.3.0",
"angular-google-maps-native": "~2.0.0",
"angular-mocks": "~1.3.0",
"angular-resource": "^1.3.0",
"angular-route": "^1.3.0",
"angular-sanitize": "^1.3.0",
"angular-scenario": "~1.3.0",
"angular-touch": "^1.3.0",
"angular-ui-router": "~0.2.15",
"bootstrap": "^3.2.0",
"bootstrap-switch": "~3.3.2",
"eonasdan-bootstrap-datetimepicker": "~4.15.35",
"es5-shim": "^4.0.0",
"font-awesome": "~4.4.0",
"json3": "^3.3.0",
"moment": "~2.10.6",
"ng-tags-input": "3.0.0",
"requirejs": "latest",
"requirejs-domready": "latest",
"stacktrace-js": "~0.6.4",
"underscore": "~1.8.3"
},
"appPath": "."
}

还有一个指向 Gruntfile.js 的链接:http://pastebin.com/xxZwAYRW

当我运行 grunt-wiredep 时,只有这些 css 依赖项被注入(inject):

<!-- bower:css -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="bower_components/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.css" />
<link rel="stylesheet" href="bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet" href="bower_components/ng-tags-input/ng-tags-input.min.css" />
<!-- endbower -->

最佳答案

此问题因 latest(4.4.0) commit to FontAwesome 而中断.

修复非常简单。您需要设置一个覆盖(或者可能使用更少,但我不会介绍)。

{
"name": "myProject",
"version": "0.0.0",
"dependencies": {
"font-awesome": ">=4.4.0",
},
"overrides":{
"font-awesome": {
"main": [
"css/font-awesome.css"
]
}
}
}

OR(因为 fontawesome/font-awesome 两个名字都注册了)

{
"name": "myProject",
"version": "0.0.0",
"dependencies": {
"fontawesome": ">=4.4.0",
},
"overrides":{
"fontawesome": {
"main": [
"css/font-awesome.css"
]
}
}
}

关于javascript - Grunt wiredep 没有注入(inject) font-awesome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32308003/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com