Skip to content

Instantly share code, notes, and snippets.

@cikoriicabachkov
Last active August 29, 2015 14:14
Show Gist options
  • Save cikoriicabachkov/08e966e4131477f1f24f to your computer and use it in GitHub Desktop.
Save cikoriicabachkov/08e966e4131477f1f24f to your computer and use it in GitHub Desktop.
Simple livereload server (gulp + browser-sync)
// Quick start guide
// 1) install node.js, npm
// 2) run command: npm install gulp browser-sync
// 3) run command: gulp
// 4) ?????
// 5) PROFIT
var gulp = require('gulp');
var browserSync = require('browser-sync');
// set root dir and files to watch only
var baseDirPath = "./sp-right/",
watchedFiles = ["./sp-right/css/*.css", "./sp-right/js/*.js", "./sp-right/*.html"];
gulp.task('browser-sync', function() {
browserSync.init(watchedFiles, {
server: {
baseDir: baseDirPath
}
});
});
gulp.task('default', ['browser-sync'], function () {
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment