0

I don't know why, but I have a problem with a little Yeoman project with Bower and Gulp.

Little question:

I installed a component with this command.

bower install angular-bootstrap-show-errors -S

That's works great.

But if I look in the gulpfile.js of my project it looks like.

vendor: {
  js: [
    './bower_components/angular/angular.js',
    './bower_components/angular-route/angular-route.js',
    './bower_components/mobile-angular-ui/dist/js/mobile-angular-ui.js'
  ],

  fonts: [
    './bower_components/font-awesome/fonts/fontawesome-webfont.*'
  ]
},

But the installed component is missing.

I've tried to search with google but I can't find any solution.

If I try to add config.vendor.js.push('.bower_components/angular-bootstrap-show-errors/src/showErrors.js'); to config.js it wouldn't work, too. (After bower install and gulp build)

How I can add a installed bower component to gulp?

Thanks in advance for any idea!

NateW
  • 2,101
  • 3
  • 28
  • 37
PatrickB
  • 3,225
  • 5
  • 31
  • 55

1 Answers1

0

Bower's only responsibility is to update the bower.json file. You can just add it to your gulpfile

vendor: {
  js: [
    './bower_components/angular/angular.js',
    './bower_components/angular-route/angular-route.js',
    './bower_components/mobile-angular-ui/dist/js/mobile-angular-ui.js',
    './bower_components/angular-bootstrap-show-errors/src/showErrors.js'
  ],

  fonts: [
    './bower_components/font-awesome/fonts/fontawesome-webfont.*'
  ]
},

Edit:

For angular-mobile-ui, instead of altering the gulpfile, add

config.js:

config.vendor.js.push('.bower_components/angular-bootstrap-show-errors/src/showErrors.js');

and 'ui.bootstrap.showErrors' to your app's dependencies:

/src/js/app.js:

angular.module('MyApp', [
  'ngRoute',
  'mobile-angular-ui',
  'ui.bootstrap.showErrors',
  'MyApp.controllers.Main'
])

This works because in the gulpfile the settings in config.js are loaded by:

if (require('fs').existsSync('./config.js')) {
  var configFn = require('./config');
  configFn(config);
}
dting
  • 38,604
  • 10
  • 95
  • 114