Skip to content

Instantly share code, notes, and snippets.

@Olgagr
Last active July 5, 2017 10:39
Show Gist options
  • Save Olgagr/e3efacebc74205ff898b to your computer and use it in GitHub Desktop.
Save Olgagr/e3efacebc74205ff898b to your computer and use it in GitHub Desktop.
watchify
var customOpts = {
entries: [config.jsES6MainFile],
debug: true,
transform: ['babelify']
};
var opts = _.assign({}, watchify.args, customOpts);
var b = watchify(browserify(opts));
gulp.task('scripts', bundle);
b.on('update', bundle);
function bundle () {
return b.bundle()
.on('error', function(e) {
$.util.log(e.toString());
this.emit('end');
})
.pipe(source(config.jsES5DestFileName))
.pipe(gulp.dest(config.tmp));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment