我正在阅读有关使用 Yeoman (http://yeoman.io/codelab.html) 设置 AngularJS 应用程序的教程,并且 Bootstrap 的 CSS 文件未包含在 index.html 文件中。因此,当我运行 grunt serve 时,该页面缺少所有 Bootstrap 样式,这与教程图像中显示的不同。
Bootstrap javascript 文件包含在 index.html 文件中。
这是正常行为还是我打算手动包含它?我本来希望运行 Grunt Wiredep 将 Bootstrap css 文件包含在 <!-- bower:css --><!-- endbower -->
之间。 index.html 文件中的占位符?
最佳答案
将 bootstrap 的覆盖代码添加到您的 bower.json 文件中(不要编辑 bower_components
中的任何内容)
"dependencies": {
...
},
"overrides": {
"bootstrap": {
"main": [
"dist/js/bootstrap.js",
"dist/css/bootstrap.css",
"less/bootstrap.less"
]
}
}
http://blog.getbootstrap.com/2015/06/15/bootstrap-3-3-5-released/
关于angularjs - Grunt Wiredep 没有在 Yeoman Angular 教程中注入(inject) Bootstrap css 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31015812/