Skip to content

Instantly share code, notes, and snippets.

@johnpeele
Created November 14, 2014 13:29
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 johnpeele/2b7ad65f36b06ba432c4 to your computer and use it in GitHub Desktop.
Save johnpeele/2b7ad65f36b06ba432c4 to your computer and use it in GitHub Desktop.
Gulp / Harp with BrowserSync
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