Created
February 10, 2015 15:58
-
-
Save fgandellini/ee2ded45d71937188ec4 to your computer and use it in GitHub Desktop.
gulp task for bundling with browserify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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