-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathgulpfile.js
More file actions
30 lines (25 loc) · 738 Bytes
/
Copy pathgulpfile.js
File metadata and controls
30 lines (25 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var gulp = require('gulp'),
livereload = require('gulp-livereload'),
server = require('./server.js');
// gulp.task('css', function(){
// gulp.src('css/*.css').pipe(livereload());
// });
function notifyLiveReload(event) {
var fileName = require('path').relative(__dirname, event.path);
tinylr.changed({
body: {
files: [fileName]
}
});
}
gulp.task('watch', function(){
gulp.watch('app/**/*.html', notifyLiveReload);
gulp.watch('app/**/*.js', notifyLiveReload);
gulp.watch('app/assets/css/*.css', notifyLiveReload);
});
var tinylr;
gulp.task('livereload', function() {
tinylr = require('tiny-lr')();
tinylr.listen(35729);
});
gulp.task('default', ['express', 'livereload', 'watch']);