chore(gulp): re-enable browsersync watching for non-API files

This commit is contained in:
Peter Bacon Darwin 2015-11-12 22:16:46 +00:00
parent b82e229ade
commit 021c12d58a
1 changed files with 8 additions and 10 deletions

View File

@ -26,6 +26,7 @@ var TOOLS_PATH = './tools';
var ANGULAR_PROJECT_PATH = '../angular'; var ANGULAR_PROJECT_PATH = '../angular';
var PUBLIC_PATH = './public'; var PUBLIC_PATH = './public';
var DOCS_PATH = path.join(PUBLIC_PATH, 'docs'); var DOCS_PATH = path.join(PUBLIC_PATH, 'docs');
var NOT_API_DOCS_GLOB = path.join(PUBLIC_PATH, './{docs/*/latest/!(api),!(docs)}/**/*');
var RESOURCES_PATH = path.join(PUBLIC_PATH, 'resources'); var RESOURCES_PATH = path.join(PUBLIC_PATH, 'resources');
var docShredder = require(path.resolve(TOOLS_PATH, 'doc-shredder/doc-shredder')); var docShredder = require(path.resolve(TOOLS_PATH, 'doc-shredder/doc-shredder'));
@ -67,16 +68,13 @@ gulp.task('serve-and-sync', ['build-docs'], function (cb) {
var browserSync = require('browser-sync').create(); var browserSync = require('browser-sync').create();
browserSync.init({ browserSync.init({
proxy: 'localhost:9000' proxy: 'localhost:9000',
reloadDelay: 500
}); });
devGuideExamplesWatch(_devguideShredOptions, function() { devGuideExamplesWatch(_devguideShredOptions, browserSync.reload);
browserSync.reload(); apiSourceWatch(browserSync.reload);
}); gulp.watch(NOT_API_DOCS_GLOB, browserSync.reload);
apiSourceWatch(function() {
browserSync.reload();
});
}); });
@ -86,10 +84,10 @@ gulp.task('build-and-serve', ['build-docs'], function (cb) {
var browserSync = require('browser-sync').create(); var browserSync = require('browser-sync').create();
browserSync.init({ browserSync.init({
proxy: 'localhost:9000', proxy: 'localhost:9000',
files: [path.join(DOCS_PATH, '**/*/**/*')],
logFileChanges: true,
reloadDelay: 500 reloadDelay: 500
}); });
gulp.watch(NOT_API_DOCS_GLOB, browserSync.reload);
}); });
gulp.task('build-docs', ['_shred-devguide-examples', 'build-api-docs', '_zip-examples'], function() { gulp.task('build-docs', ['_shred-devguide-examples', 'build-api-docs', '_zip-examples'], function() {