Skip to content

Error if bower dependencies are empty #159

@Horttcore

Description

@Horttcore

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());
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions