From 24468159e7853a605757161f0fdaee7df1dbe71f Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Thu, 23 Mar 2017 12:44:33 +0100 Subject: [PATCH] Gulp: Only cache templates/scripts if not gulping for production --- gulpfile.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index f16853da..99d81aac 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -18,6 +18,7 @@ var enabled = { maps: argv.production, failCheck: argv.production, prettyPug: !argv.production, + cachify: !argv.production, liveReload: !argv.production }; @@ -41,7 +42,7 @@ gulp.task('styles', function() { gulp.task('templates', function() { gulp.src('src/templates/**/*.jade') .pipe(gulpif(enabled.failCheck, plumber())) - .pipe(cache('templating')) + .pipe(gulpif(enabled.cachify, cache('templating'))) .pipe(jade({ pretty: enabled.prettyPug })) @@ -54,7 +55,7 @@ gulp.task('templates', function() { gulp.task('scripts', function() { gulp.src('src/scripts/*.js') .pipe(gulpif(enabled.failCheck, plumber())) - .pipe(cache('scripting')) + .pipe(gulpif(enabled.cachify, cache('scripting'))) .pipe(gulpif(enabled.maps, sourcemaps.init())) .pipe(gulpif(enabled.uglify, uglify())) .pipe(rename({suffix: '.min'}))