From 0f079c14faa5bfcc41ac43d49148051cc23735be Mon Sep 17 00:00:00 2001 From: Christopher Charbonneau Wells Date: Tue, 22 Aug 2017 12:56:30 -0400 Subject: [PATCH] Add watchConfig for gulp watch. --- gulpfile.js/config.js | 11 +++++++++++ gulpfile.js/tasks/watch.js | 13 ++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gulpfile.js/config.js b/gulpfile.js/config.js index eb525272..bcad9056 100644 --- a/gulpfile.js/config.js +++ b/gulpfile.js/config.js @@ -39,5 +39,16 @@ module.exports = { 'node_modules/font-awesome/css/font-awesome.css' ], app: 'babyblotter/static_site/scss/babyblotter.scss' + }, + watchConfig: { + scriptsGlob: [ + '**/static/js/**/*.js', + 'babyblotter/static_site/js/**/*.js', + '!babyblotter/static/js/' + ], + stylesGlob: [ + '**/static/scss/**/*.scss', + 'babyblotter/static_site/scss/**/*.scss' + ] } }; diff --git a/gulpfile.js/tasks/watch.js b/gulpfile.js/tasks/watch.js index 55a2ed05..3b3087ae 100644 --- a/gulpfile.js/tasks/watch.js +++ b/gulpfile.js/tasks/watch.js @@ -1,19 +1,14 @@ var gulp = require('gulp'); +var watchConfig = require('../config.js').watchConfig; + gulp.task('watch', ['watch:scripts', 'watch:styles']); gulp.task('watch:scripts', function() { - return gulp.watch([ - '**/static/js/**/*.js', - 'babyblotter/static_site/js/**/*.js', - '!babyblotter/static/js/' - ], ['scripts:app']); + return gulp.watch(watchConfig.scriptsGlob, ['scripts:app']); }); gulp.task('watch:styles', function() { - return gulp.watch([ - '**/static/scss/**/*.scss', - 'babyblotter/static_site/scss/**/*.scss' - ], ['styles:app']); + return gulp.watch(watchConfig.stylesGlob, ['styles:app']); });