Created
December 28, 2014 06:33
-
-
Save vastus/36350eab636b481e0cb1 to your computer and use it in GitHub Desktop.
Gulp file for browserify w/ vinyl source stream
This file contains 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 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