feat(frontend): improve scss build for production

This commit is contained in:
Andrey Antukh 2019-07-02 20:04:15 +02:00
parent 5fdcae4196
commit 7c1168e797
3 changed files with 42 additions and 5 deletions

View file

@ -6,6 +6,7 @@ const mustache = require("gulp-mustache");
const rename = require("gulp-rename");
const gulpif = require("gulp-if");
const gzip = require("gulp-gzip");
const cleancss = require("gulp-clean-css");
const paths = {};
paths.app = "./resources/";
@ -54,10 +55,14 @@ function scssPipeline(options) {
const output = options.output;
return gulp.src(input)
// .pipe(plumber())
.pipe(scss({style: "expanded"}))
.pipe(scss({
style: "expanded",
errLogToConsole: false
}).on("error", (err) => {
console.log(err.messageFormatted);
}))
.pipe(makeAutoprefixer())
// .pipe(gulpif(isProduction, cssmin()))
.pipe(gulpif(isProduction, cleancss()))
.pipe(gulp.dest(output));
};
}