Skip to content

Instantly share code, notes, and snippets.

@ahmednuaman
Created January 6, 2015 16:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmednuaman/be4e5a0f9c9e92f260d6 to your computer and use it in GitHub Desktop.
Save ahmednuaman/be4e5a0f9c9e92f260d6 to your computer and use it in GitHub Desktop.
Getting BrowserSync and gulp-watch to play nicely
var browserSync = require('browser-sync'),
common = require('./__common__'),
gulp = require('gulp'),
watch = require('gulp-watch');
gulp.task('default', [
'less'
], function () {
browserSync({
server: {
baseDir: process.cwd()
},
port: 8000
});
watch([
common.files.css + '**/*',
common.files.img + '**/*',
common.files.js + '**/*',
common.files.html
], function (vinyl) {
browserSync.reload(vinyl.relative);
});
watch(common.files.less, function () {
gulp.start('less');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment