Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

main-bower-files gulp returns empty array

I'm trying to use the plugin main-bower-files and it doesn't seem to be able to pull the directory from bower_components.

Its debug message shows it has the right files, but it doesn't return an array

#here you can see the debug finding the places
PackageCollection add        angular bower_components/angular
PackageCollection add        json3 bower_components/json3
PackageCollection add        es5-shim bower_components/es5-shim
PackageCollection add        jquery bower_components/jquery
PackageCollection add        angular-resource bower_components/angular-resource
PackageCollection add        angular-cookies bower_components/angular-cookies
PackageCollection add        angular-sanitize bower_components/angular-sanitize
PackageCollection add        angular-animate bower_components/angular-animate
PackageCollection add        angular-touch bower_components/angular-touch
PackageCollection add        angular-ui-router bower_components/angular-ui-router

[22:25:31] [] #< this is the result of calling require('main-bower-files')()

heres my gulp task for inject

var bowerFiles = require('main-bower-files')


gulp.task('inject', function() {
  util.log(bowerFiles({debugging:true}))
  gulp.src('app/index.jade')
    .pipe(jade({pretty: true}))
    .pipe(inject(gulp.src(bowerFiles()), {starttag: '<!-- inject:{{ext}}-->', endtag: '<!-- endinject-->'}))
    .pipe(inject(gulp.src('.tmp/**/*.js', {read: false}), {starttag: '<!-- inject:files:{{ext}}-->', endtag: '<!-- endinject-->'}))
    .pipe(connect.reload())
    .pipe(gulp.dest('.tmp'))
})
like image 203
MikaAK Avatar asked Jan 29 '26 18:01

MikaAK


1 Answers

If you have dependencies as devDependencies in bower.json you need to add ' includeDev:true

see

includeDev Type: mixed Default: false

You can include your devDependencies in two ways:

Set this option to inclusive or true to add the devDependencies to your >dependencies or use exclusive to exclude your dependencies

like image 109
D4R5C0D3 Avatar answered Feb 01 '26 01:02

D4R5C0D3



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!