Skip to content

Instantly share code, notes, and snippets.

@JeffreyWay
Created April 7, 2015 19:24
Show Gist options
  • Save JeffreyWay/911a33403f4624753ab7 to your computer and use it in GitHub Desktop.
Save JeffreyWay/911a33403f4624753ab7 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
gulp.task('browserify', function() {
return browserify('./js/app.js')
.transform(babelify, { stage: 0 })
.bundle()
.on('error', function(e){
console.log(e.message);
this.emit('end');
})
.pipe(source('bundle.js'))
.pipe(gulp.dest('js'));
});
gulp.task('watch', function() {
gulp.watch('**/*.js', ['browserify']);
});
{
"devDependencies": {
"babelify": "^6.0.2",
"browserify": "^9.0.7",
"gulp": "^3.8.11",
"gulp-plumber": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment