gulp Bower wiredep not picking up bootstrap.css?

Rolando picture Rolando · Jun 19, 2015 · Viewed 7k times · Source

I have an index.html file. In my bower.json file I have a dependency:

"bootstrap": "~3.3.2"

In a gulp file I have:

  gulp.src('./main.html')
    .pipe(wiredep({
      bowerJson: require('./bower.json')
    }))
    .pipe(gulp.dest('./'));

When I do this, I see all the css and js being generated, but do not see the bootstrap.css included anywhere within the inject, other dependencies are. What is going on?

I figure there must be a simple fix for this? Or does gulp have problems with this compared to grunt?

Update: I am getting **** thrown at me at a hardcore maven fanatic about how bower and node sucks compared to maven and how after bower install you have to manually modify a bower.json file of a package after it downloads. If there is some way to legitimately not have to modify bower.json or a way to incorporate this into the build process where were not having to require a developer to do this... please update!

Answer

m5c picture m5c · Dec 28, 2015

Instead of replacing/modifying bootstrap's bower.json we can override the main object in the project's bower.json.

"overrides":{
"bootstrap":{
  "main":[
  "dist/js/bootstrap.js",
  "dist/css/bootstrap.min.css",
  "less/bootstrap.less"
  ]
}}

This works for me!