Skip to content

Instantly share code, notes, and snippets.

@ro31337
Created March 6, 2016 01:13
Show Gist options
  • Select an option

  • Save ro31337/1516613aa5ef383329fd to your computer and use it in GitHub Desktop.

Select an option

Save ro31337/1516613aa5ef383329fd to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var server = require('gulp-server-livereload');
gulp.task('copy-html', function() {
return gulp // note "return" keyword
.src('./src/**/*.html') // copy everything, including subdirectories
.pipe(gulp.dest('dist')); // to dist folder
});
gulp.task('server', ['copy-html'], function() {
gulp
.src('./dist') // everything from ./dist directory
.pipe(server({ // pipe to server object
livereload: true, // reload when files are changed
open: true // and open the browser
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment