1

My gulp file has this in it:

gulp.task('bower2',function () {
   return gulp.src(mainBowerFiles('**/*.css'), {debugging:true})
      .pipe(gulp.dest(dist_path+'/styles'))
      ;
});

But it's not finding the CSS files, none of them. I've been successful with the js files though.

I'm not trying to do anything fancy, just build all of the css files into a single vendor.css file (in the case, font-awesome and bootstrap, that's it).

Thanks, Nick

Nick Jacobs
  • 579
  • 2
  • 9
  • 29
  • The paths are probably wrong. Can you post the rest of the code? (Particularly `mainBowerFiles()` whatever that is) – glcheetham May 10 '16 at 13:06
  • That's just the npm package mainBowerFiles(). AKA, not my code, but one from NPM. specifically, my package.json file says it's "main-bower-files" : "^2.13.0". Ironically, if I debug the pipes, I can see the .less files from font-awesome, the bootstrap.less files, just not any of the .css files under the bower_components tree. – Nick Jacobs May 10 '16 at 13:17
  • I've also tried gulp-main-bower-files as well. Same thing. – Nick Jacobs May 10 '16 at 13:18
  • 1
    I think that `main-bower-files` only finds files listed as `main` in the bower.json of the bower packages you're using. The css files won't be listed as main so `main-bower-files` won't find them – glcheetham May 10 '16 at 13:20
  • Wow, ok, that seems to fit as I look at the individual bower package's bower.json files. So is there a better way to do this? – Nick Jacobs May 10 '16 at 13:56
  • Maybe my approach is wrong on this. With Grunt, I just put the markers in my index.html file and I have a grunt task that takes all of those files between the markers, concats thens, mins them, revs them, and updates the index.html file to just point to that new reved filed. I'm trying to do the same thing with gulp. – Nick Jacobs May 10 '16 at 14:10

1 Answers1

0

Try like this.

gulp.task('bower2',function () {
   return gulp.src('**/*.css')
      .pipe(gulp.dest(dist_path+'/styles'));
});

For some reason gulp has issue with mainBowerFiles() function when you are trying to use it for css task.

Balwinder Singh
  • 2,272
  • 5
  • 23
  • 34