Skip to content

Instantly share code, notes, and snippets.

@ben-w-smith
Last active November 18, 2015 18:00
Show Gist options
  • Save ben-w-smith/6ae43120dc1f2afbdeba to your computer and use it in GitHub Desktop.
Save ben-w-smith/6ae43120dc1f2afbdeba to your computer and use it in GitHub Desktop.
Live Reload Gist
var path = {
watch: [
'file(s) you want to watch'
// example: '**/*.html'
]
};
// Include gulp
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
gulp.task('watch', function() {
plugins.livereload.listen(42857);
gulp.watch( path.watch ).on('change', function (event) {
plugins.livereload.changed(event.path);
});
});
{
"name": "LiveReload-Example",
"version": "1.0.0",
"authors": [
"Ben <benwsmith@gmail.com>"
],
"description": "LiveReload Example",
"license": "MIT",
"private": true,
"devDependencies": {
"gulp": "^3.9.0",
"gulp-concat": "^2.6.0",
"gulp-livereload": "^3.8.0",
"gulp-load-plugins": "^1.0.0-rc.1",
"gulp-shell": "^0.4.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment