Serve task: fixed issue with reload

This commit is contained in:
Roman Gotsiy 2015-10-26 20:21:09 +02:00
parent c7bc6ff391
commit 2d831f7a46
2 changed files with 9 additions and 5 deletions

View File

@ -7,7 +7,11 @@ gulp.task('serve', ['watch'], function (done) {
notify: false,
port: 9000,
server: {
baseDir: ['./demo', '.']
}
baseDir: './demo',
routes: {
'/dist': './dist'
},
},
reloadDelay: 500
}, done);
});

View File

@ -7,8 +7,8 @@ function changed(event) {
}
gulp.task('watch', ['build'], function () {
gulp.watch([ paths.source ], [ 'build', browserSync.reload ]).on('change', changed);
gulp.watch([ paths.html ], [ 'build', browserSync.reload]).on('change', changed);
gulp.watch([ paths.css ], [ 'build', browserSync.reload]).on('change', changed);
gulp.watch([ paths.source ], [ 'bundle', browserSync.reload ]).on('change', changed);
gulp.watch([ paths.html ], [ 'bundle', browserSync.reload]).on('change', changed);
gulp.watch([ paths.css ], [ 'bundle', browserSync.reload]).on('change', changed);
gulp.watch([ paths.demo ], [ '', browserSync.reload ]).on('change', changed);
});