I opened an error for GitHub: https://github.com/sindresorhus/gulp-autoprefixer/issues/45 .
It turned out that I needed to upgrade my version of Node.js to 4. Now it is 4.1.0 and the following code works:
package.json
{ "name": "a", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Kris van der Mast", "license": "ISC", "devDependencies": { "gulp": "^3.9.0", "gulp-autoprefixer":"^3.0.1" } }
gulpfile.js
"use strict"; var gulp = require('gulp'), autoprefixer = require('gulp-autoprefixer'); gulp.task('default', function () { return gulp.src('src/app.css') .pipe(autoprefixer({ browsers: ['last 2 versions'], cascade: false })) .pipe(gulp.dest('dist')); });
app.css
body { opacity: .5; box-sizing: border-box; transform: scale(.5); display: flex; }
Run gulp at this point and get the following output:
app.css after prefix
body { opacity: .5; box-sizing: border-box; -webkit-transform: scale(.5); transform: scale(.5); display: -webkit-flex; display: -ms-flexbox; display: flex; }
source share