chore(gulpfile): ignore `node_modules` folders in examples
This should speed up watching as it is unusual to update files in these folders during normal development. If you do change files in an example `node_modules` folder then you must restart the gulp task to trigger the shredder and reload.
This commit is contained in:
parent
7ac04e446b
commit
700b8e446a
|
@ -260,11 +260,10 @@ function apiSourceWatch(postBuildAction) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function apiExamplesWatch(postShredAction) {
|
function apiExamplesWatch(postShredAction) {
|
||||||
var examplesPattern =
|
var examplesPattern = path.join(ANGULAR_PROJECT_PATH, 'modules/angular2/examples/**');
|
||||||
path.join(ANGULAR_PROJECT_PATH, 'modules/angular2/examples/**/!(node_modules)/*.*');
|
|
||||||
var cleanPath = [path.join(_apiShredOptions.fragmentsDir, '**/*.*'), '!**/*.ovr.*'];
|
var cleanPath = [path.join(_apiShredOptions.fragmentsDir, '**/*.*'), '!**/*.ovr.*'];
|
||||||
|
|
||||||
watch(examplesPattern, {readDelay: 500}, function (event, done) {
|
watch([examplesPattern, '!' + examplesPattern + '/node_modules/**'], {readDelay: 500}, function (event, done) {
|
||||||
gutil.log('API example changed');
|
gutil.log('API example changed');
|
||||||
gutil.log('Event type: ' + event.event); // added, changed, or deleted
|
gutil.log('Event type: ' + event.event); // added, changed, or deleted
|
||||||
gutil.log('Event path: ' + event.path); // The path of the modified file
|
gutil.log('Event path: ' + event.path); // The path of the modified file
|
||||||
|
@ -276,8 +275,8 @@ function apiExamplesWatch(postShredAction) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function devGuideExamplesWatch(shredOptions, postShredAction) {
|
function devGuideExamplesWatch(shredOptions, postShredAction) {
|
||||||
var pattern = path.join(shredOptions.examplesDir, "**/!(node_modules)/**/*");
|
var examplesPattern = path.join(shredOptions.examplesDir);
|
||||||
watch(pattern, { readDelay: 500 }, function (event, done) {
|
watch([examplesPattern, '!' + examplesPattern + '/node_modules/**'], {readDelay: 500}, function (event, done) {
|
||||||
gutil.log('Dev Guide example changed')
|
gutil.log('Dev Guide example changed')
|
||||||
gutil.log('Event type: ' + event.event); // added, changed, or deleted
|
gutil.log('Event type: ' + event.event); // added, changed, or deleted
|
||||||
gutil.log('Event path: ' + event.path); // The path of the modified file
|
gutil.log('Event path: ' + event.path); // The path of the modified file
|
||||||
|
|
Loading…
Reference in New Issue