I'm trying to use wiredep
to inject bower dependencies. I am confused a little about how it works, and why it is only working for my JS files.
gulp.task('wiredep', function(cb){
gulp.src('./index.html')
.pipe(wiredep())
.pipe(gulp.dest('.'));
});
What does the final line gulp.dest('.')
do? wouldn't the destination be my index.html file. Also, this task only seems to inject javascript files. I have in my bower.json dependencies for
"bootstrap": "~3.3.6",
"bourbon": "~4.2.6",
"jquery": "~2.1.4",
"neat": "~1.7.2"
Bootstrap, Bourbon, and neat, all have large amounts of CSS, yet the
<!-- bower:css -->
<!-- endbower -->
remain empty after running gulp wiredep
. Why would this be?
bower.json deps look like this:
"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"
}
First of all add the official workaround from the bootstrap blog to your project's bower.json
file:
"dependencies": {
...
},
"overrides": {
"bootstrap": {
"main": [
"dist/js/bootstrap.js",
"dist/css/bootstrap.css",
"less/bootstrap.less"
]
}
}
For other packages the pattern would be the same but change the path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With