Update postcss task

This commit is contained in:
Dan Mindru 2019-08-31 16:55:01 +02:00
parent 268cbed282
commit 29354f0920
1 changed files with 15 additions and 13 deletions

View File

@ -1,22 +1,24 @@
'use strict'; 'use strict';
var gulp = require('gulp'), const gulp = require('gulp'),
postcss = require('gulp-postcss'), postcss = require('gulp-postcss'),
autoprefixer = require('autoprefixer'); autoprefixer = require('autoprefixer');
function postcssTask(options){ function postcssTask(options){
gulp.task('postcss', ['dupe'], function () { // Requires: dupe.
var processors = [ gulp.task(
autoprefixer({ 'postcss',
browsers: ['last 5 versions'] function() {
}) var processors = [
]; autoprefixer()
];
return options return options
.src(options.workingDir + '/**/*.css') .src(options.workingDir + '/**/*.css')
.pipe(postcss(processors)) .pipe(postcss(processors))
.pipe(gulp.dest(options.workingDir)); .pipe(gulp.dest(options.workingDir));
}); }
);
} }
module.exports = postcssTask; module.exports = postcssTask;