From 1559e1b61f52054af6d71d8d5d38c77e66192de8 Mon Sep 17 00:00:00 2001 From: Matej Simek Date: Mon, 9 Oct 2017 13:52:49 +0200 Subject: [PATCH] styles: disableSourcemaps config option to disable source maps generation --- lib/tasks/styles.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/tasks/styles.js b/lib/tasks/styles.js index cdbc9c8b..22fa837e 100644 --- a/lib/tasks/styles.js +++ b/lib/tasks/styles.js @@ -40,9 +40,11 @@ module.exports = function(gulp, config) { // Init sourcemaps and plumber in devmode if(config.devmode){ - task = task - .pipe(plumber({ errorHandler: errorHandler.fail })) - .pipe(sourcemaps.init()) + task = task.pipe(plumber({ errorHandler: errorHandler.fail })) + + if(config.disableSourcemaps !== true) { + task = task.pipe(sourcemaps.init()) + } } // Stylus part @@ -78,7 +80,9 @@ module.exports = function(gulp, config) { } } else { - task = task.pipe(sourcemaps.write('.')) + if(config.disableSourcemaps !== true) { + task = task.pipe(sourcemaps.write('.')) + } } if(config.devmode){