Last active
March 21, 2018 10:27
-
-
Save holykol/4a05641566efdf4c7653a5e640b49e5d to your computer and use it in GitHub Desktop.
Simple HTML livereload
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
// yarn init -y && yarn add gulp gulp-connect gulp-watch | |
var gulp = require('gulp'), | |
connect = require('gulp-connect'), | |
watch = require('gulp-watch'); | |
gulp.task('serve', function(event) { | |
connect.server({ | |
root: "./", | |
port: 3000, | |
livereload: true | |
}); | |
// sets up a livereload that watches for any changes in the root | |
watch("./*") | |
.pipe(connect.reload()); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment