Skip to content

Instantly share code, notes, and snippets.

@simonmcmanus
Created February 2, 2015 15:11
Show Gist options
  • Save simonmcmanus/386570ebf32c8ec25beb to your computer and use it in GitHub Desktop.
Save simonmcmanus/386570ebf32c8ec25beb to your computer and use it in GitHub Desktop.
gulp-watchify
var bundler = watchify(browserify('./src/main.js', watchify.args));
function bundle() {
return bundler.bundle()
// log errors if they happen
.on('error', notify.onError(notifyError))
.pipe(source('src/main.js'))
.pipe(buffer())
.pipe(rename('kormorant-dev.min.js'))
.pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist'));
}
// bundler.transform('brfs');
// bundler.on('update', bundle);
// use watchify to so we only rebuild the front end bundle when it needs to be rebuild.
//gulp.task('watch', bundle);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment