Last active
July 5, 2017 10:39
-
-
Save Olgagr/e3efacebc74205ff898b to your computer and use it in GitHub Desktop.
watchify
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
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