Created
November 14, 2014 13:29
-
-
Save johnpeele/2b7ad65f36b06ba432c4 to your computer and use it in GitHub Desktop.
Gulp / Harp with BrowserSync
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 browserSync = require('browser-sync'); | |
var cp = require('child_process'); | |
var harp = require('harp') | |
gulp.task('serve', function (done) { | |
harp.server('.', { | |
port: 9000 | |
}); | |
}); | |
gulp.task('build', function (done) { | |
cp.exec('harp compile . dist', {stdio: 'inherit'}) | |
.on('close', done) | |
}); | |
gulp.task('watch', function () { | |
gulp.watch("public/**/*.{jade,styl,haml,sass,scss,less}", browserSync.reload) | |
}); | |
gulp.task('browser-sync', function() { | |
browserSync({ | |
proxy: "localhost:9000" | |
}); | |
}); | |
gulp.task('default', ['serve', 'browser-sync', 'watch']); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment