function css() {
return src(path.src.css)
.pipe(
scss({
outputStyle: "expanded",
})
)
.pipe(
autoprefixer({
overrideBrowserslist: ["last 5 versions"],
cascade: true,
})
)
.pipe(dest(path.build.css))
.pipe(clean_css())
.pipe(
rename({
extname: ".min.css",
})
)
.pipe(dest(path.build.css))
.pipe(browsersync.stream());
}
.pipe(clean_css())
.pipe(
rename({
extname: ".min.css",
})
)
.pipe(dest(path.build.css))
const gulpIf = require('gulp-if');
const isProd = process.env.NODE_ENV === 'production';
//...
.pipe(dest(path.build.css))
.pipe(gulpIf(isProd, clean_css()))
.pipe(gulpIf(isProd, rename({ extname: ".min.css" }))
.pipe(gulpIf(isProd, dest(path.build.css)))
//...