Wiredep不会插入凉亭CSS依赖关系
我试图使用wiredep
来注wiredep
依赖。 我很困惑它是如何工作的,为什么它只为我的JS文件工作。
gulp.task('wiredep', function(cb){ gulp.src('./index.html') .pipe(wiredep()) .pipe(gulp.dest('.')); });
最后一行gulp.dest('.')
做什么? 目标不会是我的index.html文件。 此外,这个任务似乎只注入JavaScript文件。 我在我的bower.json依赖关系中
"bootstrap": "~3.3.6", "bourbon": "~4.2.6", "jquery": "~2.1.4", "neat": "~1.7.2"
Bootstrap,波本,整齐,都有大量的CSS,但是
<!-- bower:css --> <!-- endbower -->
运行gulp wiredep
后保持空白。 为什么会这样?
bower.json deps看起来像这样:
"dependencies": { "angular": "~1.4.8", "bitters": "~1.1.0", "bourbon": "~4.2.6", "font-awesome": "fontawesome#~4.5.0", "jquery": "~2.1.4", "neat": "~1.7.2" }
首先,从bootstrap博客添加官方解决scheme到您的项目的bower.json
文件:
"dependencies": { ... }, "overrides": { "bootstrap": { "main": [ "dist/js/bootstrap.js", "dist/css/bootstrap.css", "less/bootstrap.less" ] } }
对于其他包,模式将是相同的,但改变path。