Skip to content

Commit

Permalink
#1: move options for “watch” task to config
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanfalkowski committed Mar 16, 2019
1 parent 191093f commit 3fa41e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
5 changes: 5 additions & 0 deletions gulp/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ var task = {
path.assets + 'js/src/**/*.js',
'!' + path.assets + 'js/src/vendor/**'
]
},
watch: {
options: {
ignoreInitial: false
}
}
};

Expand Down
16 changes: 7 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,19 @@ function lintJs () {
// ==============================================

function watch () {
var options = {
ignoreInitial: false
};
var task = config.task.watch;

// CSS
gulp.watch(config.task.css.src, options, gulp.parallel(lintCss, css));
gulp.watch(config.task.css.src, task.options, gulp.parallel(lintCss, css));

// Image
gulp.watch(config.task.image.src, options, gulp.parallel(image));
gulp.watch(config.task.image.src, task.options, gulp.parallel(image));

// JS
gulp.watch(config.task.jsAppPre.src, options, gulp.parallel(lintJs, jsAppPre));
gulp.watch(config.task.jsAppPost.src, options, gulp.parallel(lintJs, jsAppPost));
gulp.watch(config.task.jsAppPostDefer.src, options, gulp.parallel(lintJs, jsAppPostDefer));
gulp.watch(config.task.jsThing.src, options, gulp.parallel(lintJs, jsThing));
gulp.watch(config.task.jsAppPre.src, task.options, gulp.parallel(lintJs, jsAppPre));
gulp.watch(config.task.jsAppPost.src, task.options, gulp.parallel(lintJs, jsAppPost));
gulp.watch(config.task.jsAppPostDefer.src, task.options, gulp.parallel(lintJs, jsAppPostDefer));
gulp.watch(config.task.jsThing.src, task.options, gulp.parallel(lintJs, jsThing));
}


Expand Down

0 comments on commit 3fa41e1

Please sign in to comment.