Forked from mattwelke/browsersync for ghost hbs and css
Created
August 10, 2021 13:41
-
-
Save dbugshe2/1a4d8b59146bc7dd2ce01f6ea2333a7a 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 browserSync = require('browser-sync').create(); | |
// Static Server + watching css/html files | |
gulp.task('serve', ['css'], function() { | |
browserSync.init({ | |
proxy: "http://localhost:2368" | |
}); | |
gulp.watch("content/themes/casper/assets/built/*.css", ['css']); | |
gulp.watch("content/themes/casper/*.hbs").on('change', browserSync.reload); | |
}); | |
// auto-inject CSS into browsers | |
gulp.task('css', function() { | |
return gulp.src("content/themes/casper/assets/built/*.css") | |
.pipe(browserSync.stream()); | |
}); | |
gulp.task('default', ['serve']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment