From b2e8a5cf86e25cea8b061474622b2ae6fe0b8fc7 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Wed, 6 Jul 2022 13:08:39 -0400 Subject: [PATCH] Prepare for migration to mr hope's gulp-sass 3.x --- gulpfile.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 277c919..0f568c0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -28,19 +28,21 @@ const webpack = require("webpack"), // Determine if gulp has been run with --production const isProduction = minimist(process.argv.slice(2)).production !== undefined; +// Declare plugin settings +const sassOutputStyle = isProduction ? "compressed" : "expanded", + sassPaths = "node_modules", + autoprefixerSettings = { remove: false, cascade: false }; + // Include browsersync when gulp has not been run with --production let browserSync = undefined; -if (isProduction) { - process.env.NODE_ENV = "production"; -} else { +if (!isProduction) { browserSync = require("browser-sync").create(); } -// Declare plugin settings -const sassOutputStyle = isProduction ? "compressed" : "expanded", - sassPaths = [ "node_modules" ], - autoprefixerSettings = { remove: false, cascade: false }; +// Environment +process.env.NODE_ENV = isProduction ? "production" : "development"; +process.env.SASS_PATH = sassPaths; // Javascript files for the public site const jsPublic = "resources/js/app.js"; @@ -93,7 +95,7 @@ function processSass(filename) { const css = gulp.src(`resources/sass/${filename}.scss`) .pipe(plumber(handleError)) .pipe(sassGlob()) - .pipe(sass({ outputStyle: sassOutputStyle, includePaths: sassPaths })) + .pipe(sass({ outputStyle: sassOutputStyle })) .pipe(postCSS([ autoprefixer(autoprefixerSettings) ])) .pipe(concat(`${filename}.css`)) .pipe(gulp.dest("public/css/"));