Skip to content

Instantly share code, notes, and snippets.

@perguth
Last active August 29, 2015 14:17
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 perguth/f5523bd3b3b31953da5e to your computer and use it in GitHub Desktop.
Save perguth/f5523bd3b3b31953da5e to your computer and use it in GitHub Desktop.
var gulp = require('gulp')
var fs = require('fs')
var browserify = require('browserify')
var babelify = require('babelify')
gulp.task('default', function () {
// place code for your default task here
})
gulp.task('watch', function () {
gulp.watch(['index.js', 'js/**/*.js'], function (event) {
browserify({ debug: true })
.transform(babelify)
.require('./index.js', { entry: true })
.bundle()
.on('error', function (err) { console.log('Error: ' + err.message) })
.pipe(fs.createWriteStream('bundle.js'))
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment