-
-
Save chrisabrams/395013f8894d4eb34b28 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 source = require('vinyl-source-stream'); | |
var watchify = require('watchify'); | |
var livereload = require('gulp-livereload'); | |
var hbsfy = require("hbsfy").configure({ | |
extensions: ["html"] | |
}); | |
gulp.task('watch', function() { | |
var bundler = watchify('./public/js/app.js'); | |
bundler.transform(hbsfy); | |
bundler.on('update', rebundle); | |
function rebundle() { | |
return bundler.bundle() | |
.pipe(source('bundle.js')) | |
.pipe(gulp.dest('./public/dist/js/')).pipe(livereload()); | |
} | |
return rebundle(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment