mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-21 07:32:31 -05:00
Fix sass minification
This commit is contained in:
parent
a527fdb30a
commit
e4a4dbbedb
1 changed files with 9 additions and 5 deletions
14
gulpfile.js
14
gulpfile.js
|
@ -29,8 +29,7 @@ const webpack = require("webpack"),
|
|||
const isProduction = minimist(process.argv.slice(2)).production !== undefined;
|
||||
|
||||
// Declare plugin settings
|
||||
const sassOutputStyle = isProduction ? "compressed" : "expanded",
|
||||
sassPaths = "node_modules",
|
||||
const sassPaths = "node_modules",
|
||||
autoprefixerSettings = { remove: false, cascade: false };
|
||||
|
||||
// Include browsersync when gulp has not been run with --production
|
||||
|
@ -95,10 +94,15 @@ function processSass(filename) {
|
|||
const css = gulp.src(`resources/sass/${filename}.scss`)
|
||||
.pipe(plumber(handleError))
|
||||
.pipe(sassGlob())
|
||||
.pipe(sass({ outputStyle: sassOutputStyle }))
|
||||
.pipe(sass({ quietDeps: true }))
|
||||
.pipe(postCSS([ autoprefixer(autoprefixerSettings) ]))
|
||||
.pipe(concat(`${filename}.css`))
|
||||
.pipe(gulp.dest("public/css/"));
|
||||
.pipe(concat(`${filename}.css`));
|
||||
|
||||
if (isProduction) {
|
||||
css.pipe(cleanCSS());
|
||||
}
|
||||
|
||||
css.pipe(gulp.dest("public/css/"));
|
||||
|
||||
if (!isProduction) {
|
||||
css.pipe(browserSync.stream({ match: `**/${filename}.css` }));
|
||||
|
|
Loading…
Reference in a new issue