I'm struggling to make Autoprefixer work with Gulp. Despite using opacity, gradients, and transforms in my CSS, I can't see any vendor prefixes being added. However, everything else seems to be functioning correctly.
Below is my gulp file:
var gulp = require('gulp');
var lr = require('tiny-lr');
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var livereload = require('gulp-livereload');
var server = lr();
var plumber = require('gulp-plumber');
var onError = function (err) {
gutil.beep();
console.log(err);
};
gulp.task('lint', function() {
return gulp.src('js/all.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('sass', function() {
return gulp.src('scss/*.scss')
.pipe(sass({errLogToConsole: true}))
.pipe(autoprefixer('last 2 versions', 'safari 5', 'ie6', 'ie7', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(minifycss())
.pipe(gulp.dest(''))
.pipe(plumber({
errorHandler: onError
}))
.pipe(livereload(server));
});
gulp.task('scripts', function() {
return gulp.src(['js/fittext.js', 'js/fitvids.js', 'js/snap-scroll.js', 'js/cycle-min.js', 'js/all.js', 'js/respond.js'])
.pipe(concat('all.js'))
.pipe(gulp.dest('js/min'))
.pipe(rename('main.min.js'))
.pipe(gulp.dest('js/min'))
.pipe(plumber({
errorHandler: onError
}))
.pipe(livereload(server));
});
gulp.task('watch', function() {
livereload.listen();
gulp.watch('**/*.php').on('change', livereload.changed);
gulp.watch('js/*.js', ['scripts']);
gulp.watch('scss/**/*.scss', ['sass']);
});
gulp.task('default', ['lint', 'sass', 'scripts', 'watch']);
- I've exhaustively researched various solutions to this issue but have not found a resolution yet. I also attempted changing
.pipe(gulp.dest(''))
to a specific directory following suggestions like this one, unfortunately with no success.
Your assistance would be greatly appreciated.
* UPDATE *
I must admit my misunderstanding regarding Autoprefixer's behavior with opacity properties.