After following the recipe from the official gulp repo for using browserify with multiple entry points, everything worked smoothly when I only had one file. However, now that I am trying to run the task for multiple files, it displays
the following tasks did not complete: browserify.
Did you forget to signal async completion?
Unfortunately, I am working with Gulp 4 on this project. Here is my modified task:
gulp.task('browserify', function() {
var bundledStream = through();
bundledStream.pipe(source('./public/static/js-dev/bundles/*.js'))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
.on('error', gutil.log)
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(local.jsDist+'/bundles'));
globby(['./public/static/js-dev/bundles/*.js'], function(err, entries) {
if (err) {
bundledStream.emit('error', err);
return;
}
var b = browserify({
entries: entries,
debug: true
});
b.bundle().pipe(bundledStream);
});
return bundledStream;
});
I'm not sure where I've gone wrong - all I want is for this to work properly.