mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-25 00:51:25 -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
|
||||
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/"));
|
||||
|
|
Loading…
Reference in a new issue