Skip to content

Instantly share code, notes, and snippets.

@tracker1
Created October 28, 2014 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tracker1/428fa014300ee0fbab5a to your computer and use it in GitHub Desktop.
Save tracker1/428fa014300ee0fbab5a to your computer and use it in GitHub Desktop.
watchify gulp
gulp.task('watch-scripts', function() {
var watchify = require('watchify')
var util = require('gulp-util')
var source = require('vinyl-source-stream')
var watcher = watchify('./src/index.js')
var bundle = function() {
return watcher
.bundle({debug: true})
.on('error', util.log)
.pipe(source('client.js'))
.pipe(gulp.test('./build'))
}
watcher.on('update', bundle)
return bundle()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment