Skip to content

Instantly share code, notes, and snippets.

@fgandellini
Created February 10, 2015 15:58
Show Gist options
  • Save fgandellini/ee2ded45d71937188ec4 to your computer and use it in GitHub Desktop.
Save fgandellini/ee2ded45d71937188ec4 to your computer and use it in GitHub Desktop.
gulp task for bundling with browserify
gulp.task('bundle', function () {
watchify.args.debug = true;
//watchify.args.ignoreMissing = true;
var bundler = watchify(browserify('./main.js', watchify.args));
bundler.on('update', rebundle);
function rebundle() {
return bundler.bundle()
//.pipe(exorcist(__dirname + '/dist/bundle.js.map'))
// log errors if they happen
.on('error', gutil.log.bind(gutil, 'Browserify Error'))
.pipe(source('bundle.js'))
.pipe(gulp.dest('./dist'));
}
return rebundle();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment