From 95fdc92b7be94de7e970043be39b369e2c886b46 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 22 Jan 2018 05:34:55 +0100 Subject: [PATCH] Allow for disabling the cache --- lib/index.js | 8 +++++++- src/index.js | 11 +++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index b918f8e..8332726 100644 --- a/lib/index.js +++ b/lib/index.js @@ -11,7 +11,13 @@ module.exports = function () { var cacheKey = options.cacheKey != null ? options.cacheKey : "preset"; - var streamList = [cache(cacheKey), sass()]; + var streamList = []; + + if (cacheKey !== false) { + streamList.push(cache(cacheKey)); + } + + streamList.push(sass()); if (options.livereload != null) { streamList.push(livereloadPartial(options.livereload)); diff --git a/src/index.js b/src/index.js index 5c10b91..927461b 100644 --- a/src/index.js +++ b/src/index.js @@ -9,10 +9,13 @@ const sass = require("gulp-sass"); module.exports = function(options = {}) { let cacheKey = (options.cacheKey != null) ? options.cacheKey : "preset"; - let streamList = [ - cache(cacheKey), - sass() - ]; + let streamList = []; + + if (cacheKey !== false) { + streamList.push(cache(cacheKey)); + } + + streamList.push(sass()); if (options.livereload != null) { streamList.push(livereloadPartial(options.livereload));