-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
22 lines (19 loc) · 863 Bytes
/
gulpfile.js
File metadata and controls
22 lines (19 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// gulpfile.js
var gulp = require('gulp');
var server = require('gulp-express');
gulp.task('serve', function () {
// Start the server at the beginning of the task
server.run(['index.js']);
// Restart the server when file changes
gulp.watch(['**/*.html', 'images/**/*', 'app/**/*.js'], server.notify);
gulp.watch(['styles/**/*.scss'], ['styles:scss']);
//gulp.watch(['{.tmp,app}/styles/**/*.css'], ['styles:css', server.notify]);
//Event object won't pass down to gulp.watch's callback if there's more than one of them.
//So the correct way to use server.notify is as following:
gulp.watch(['{.tmp,app}/styles/**/*.css'], function(event){
gulp.run('styles:css');
server.notify(event);
});
gulp.watch(['scripts/**/*.js'], ['jshint']);
gulp.watch(['index.js', 'scripts/**/*.js'], [server.run]);
});