Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wiredep won't insert bower CSS dependencies

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"
  }
like image 567
1252748 Avatar asked Nov 25 '15 17:11

1252748


1 Answers

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.

like image 175
Farzad Yousefzadeh Avatar answered Oct 18 '22 16:10

Farzad Yousefzadeh