Last active
August 29, 2015 14:17
-
-
Save tjcelaya/73c54a567928cf7e55bb to your computer and use it in GitHub Desktop.
Super-simple Gulp task for Browserify (no fancy super-efficient watch here)
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
'use strict'; | |
var gulp = require('gulp'), | |
browserify = require('browserify'), | |
livereload = require('gulp-livereload'), | |
source = require('vinyl-source-stream'); | |
gulp.task('browserify', function () { | |
return browserify('./js/src/app.js') | |
.bundle() | |
.pipe(source('compiled.js')) // Pass desired output filename to vinyl-source-stream | |
.pipe(gulp.dest('./js/dist')); // dest takes output dir for compiled bundle | |
// both lines are necessary :( | |
}); | |
gulp.task('watch', function (){ | |
livereload.listen(); | |
gulp.watch(['path/to/js'], ['browserify']); | |
}); | |
gulp.task('default', ['watch']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the Chrome Livereload plugin for minimal setup
https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en