Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error if bower dependencies are empty #159

Open
Horttcore opened this issue Jan 16, 2017 · 3 comments
Open

Error if bower dependencies are empty #159

Horttcore opened this issue Jan 16, 2017 · 3 comments

Comments

@Horttcore
Copy link

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());
});
@ck86
Copy link
Owner

ck86 commented Jan 16, 2017

Why would you use it if you don't have dependencies?

@Horttcore
Copy link
Author

By default I have a lightbox and slider script. But sometimes I need none of them, so returning an empty array wouldn't block the rest of my default build script.

This is more like error preventing.

@ck86
Copy link
Owner

ck86 commented Jan 16, 2017

I don't get the point. You use the same gulp task for every project? When do you have the dependencies and when not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants