Skip to content

Instantly share code, notes, and snippets.

@vastus
Created December 28, 2014 06:33
Show Gist options
  • Save vastus/36350eab636b481e0cb1 to your computer and use it in GitHub Desktop.
Save vastus/36350eab636b481e0cb1 to your computer and use it in GitHub Desktop.
Gulp file for browserify w/ vinyl source stream
var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
gulp.task('js', function () {
return browserify('./src/js/application.js', { debug: true })
.bundle().on('error', handleError)
.pipe(source('application.js'))
.pipe(gulp.dest('./js'));
});
gulp.task('watch', function () {
gulp.watch([
'./src/js/*.js',
], ['js']);
});
gulp.task('default', ['js']);
function handleError(err) {
console.log(err.toString());
this.emit('end');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment