client/annotviz/gulp/tasks/watch.js
author ymh <ymh.work@gmail.com>
Fri, 23 Jan 2015 00:41:35 +0100
changeset 125 f9dd7bfed997
parent 85 eff9460bd4f2
permissions -rw-r--r--
introduce moment.js to correctly show the time

'use strict';

// var config = require('../config.js');
var gulp = require('gulp');
var livereload = require('gulp-livereload');

// Watch
gulp.task('watch', ['connect', 'serve'], function () {
  var server = livereload();
    // Watch for changes in `app` folder
    gulp.watch([
        // 'app/jade/**/*.jade',
        // 'app/*.html',
        // 'app/scss/**/*.scss',
        // 'app/scripts/**/*.js',
        // 'app/images/**/*',
        '.tmp/**/*'
    ]).on('change', function(file) {
      server.changed(file.path);
    });

    // Watch .less files
    gulp.watch('app/less/**/*.less', ['styles']);

    // Watch .js files
    gulp.watch('app/js/**/*.js', ['browserify']);

    // Watch image files
    gulp.watch('app/img/**/*', ['images']);

    // Watch .html files
    gulp.watch('app/**/*.html', ['html']);
});