mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-21 23:52:31 -05:00
Prepare for migration to mr hope's gulp-sass 3.x
This commit is contained in:
parent
e5ba9e38e3
commit
b2e8a5cf86
1 changed files with 10 additions and 8 deletions
18
gulpfile.js
18
gulpfile.js
|
@ -28,19 +28,21 @@ const webpack = require("webpack"),
|
||||||
// Determine if gulp has been run with --production
|
// Determine if gulp has been run with --production
|
||||||
const isProduction = minimist(process.argv.slice(2)).production !== undefined;
|
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
|
// Include browsersync when gulp has not been run with --production
|
||||||
let browserSync = undefined;
|
let browserSync = undefined;
|
||||||
|
|
||||||
if (isProduction) {
|
if (!isProduction) {
|
||||||
process.env.NODE_ENV = "production";
|
|
||||||
} else {
|
|
||||||
browserSync = require("browser-sync").create();
|
browserSync = require("browser-sync").create();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Declare plugin settings
|
// Environment
|
||||||
const sassOutputStyle = isProduction ? "compressed" : "expanded",
|
process.env.NODE_ENV = isProduction ? "production" : "development";
|
||||||
sassPaths = [ "node_modules" ],
|
process.env.SASS_PATH = sassPaths;
|
||||||
autoprefixerSettings = { remove: false, cascade: false };
|
|
||||||
|
|
||||||
// Javascript files for the public site
|
// Javascript files for the public site
|
||||||
const jsPublic = "resources/js/app.js";
|
const jsPublic = "resources/js/app.js";
|
||||||
|
@ -93,7 +95,7 @@ function processSass(filename) {
|
||||||
const css = gulp.src(`resources/sass/${filename}.scss`)
|
const css = gulp.src(`resources/sass/${filename}.scss`)
|
||||||
.pipe(plumber(handleError))
|
.pipe(plumber(handleError))
|
||||||
.pipe(sassGlob())
|
.pipe(sassGlob())
|
||||||
.pipe(sass({ outputStyle: sassOutputStyle, includePaths: sassPaths }))
|
.pipe(sass({ outputStyle: sassOutputStyle }))
|
||||||
.pipe(postCSS([ autoprefixer(autoprefixerSettings) ]))
|
.pipe(postCSS([ autoprefixer(autoprefixerSettings) ]))
|
||||||
.pipe(concat(`${filename}.css`))
|
.pipe(concat(`${filename}.css`))
|
||||||
.pipe(gulp.dest("public/css/"));
|
.pipe(gulp.dest("public/css/"));
|
||||||
|
|
Loading…
Reference in a new issue