It might be pointless, but it would be good if there won't be an error if there are no dependencies in the bower.json.
Here is an example from my gulpfile.
*
* Task: Scripts
*
* - Sourcemap
* - Combine
* - Concat
* - Minify
* - Sync browsers
*
*/
gulp.task('scripts', function() {
var filterJS = plugins.filter(['**/*.js','!jquery.fancybox.pack.js']); // Broken by fancy
return gulp.src(mainBowerFiles({
paths: {
bowerDirectory: 'src/bower_components',
bowerrc: '.bowerrc',
bowerJson: 'bower.json'
},
}))
.pipe(filterJS)
.pipe(plugins.addSrc.append('src/scripts/plugins/*.js'))
.pipe(plugins.addSrc.append('src/scripts/*.js'))
.pipe(plugins.plumber({errorHandler: plugins.notify.onError("Error: <%= error.message %>")}))
.pipe(plugins.sourcemaps.init())
.pipe(plugins.concat('scripts.combined.js'))
.pipe(gulp.dest('dist/scripts'))
.pipe(plugins.rename({suffix: '.min'}))
.pipe(plugins.uglify())
.pipe(plugins.sourcemaps.write('./'))
.pipe(gulp.dest('dist/scripts'))
.pipe(plugins.notify("Scripts updated"))
.pipe(browserSync.stream());
});
It might be pointless, but it would be good if there won't be an error if there are no dependencies in the bower.json.
Here is an example from my gulpfile.