diff --git a/gulpfile.js b/gulpfile.js index 9083a12..130f859 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -6,6 +6,8 @@ var gulp = require("gulp"), gPlumber = require("gulp-plumber"), gUglify = require("gulp-uglify"), gModernizr = require("gulp-modernizr"), + gPostCSS = require("gulp-postcss"), + autoprefixer = require("autoprefixer"), lessGlob = require("less-plugin-glob"), lessAutoPrefix = require("less-plugin-autoprefix"), lessCleanCSS = require("less-plugin-clean-css"); @@ -14,11 +16,11 @@ var gulp = require("gulp"), var prod = gUtil.env.production; // initialize plugins -var autoprefix = new lessAutoPrefix({ remove: false, cascade: false, browsers: [ "last 2 versions" ] }), - cleancss = new lessCleanCSS({ advanced: true }); +var cleancss = new lessCleanCSS({ advanced: true }); -// declare less plugins and modernizr tests -var lessPlugins = prod ? [ lessGlob, autoprefix, cleancss ] : [ lessGlob, autoprefix ], +// declare plugin settings and modernizr tests +var lessPlugins = prod ? [ lessGlob, cleancss ] : [ lessGlob ], + autoprefixerSettings = { remove: false, cascade: false, browsers: [ "last 6 versions" ] }, modernizrTests = []; // javascript files for the public site @@ -68,6 +70,7 @@ function processLess(filename) { return gulp.src("resources/assets/less/" + filename + ".less") .pipe(gPlumber(plumberError)) .pipe(gLess({ plugins: lessPlugins, paths: "bower_components/" })) + .pipe(gPostCSS([ autoprefixer(autoprefixerSettings) ])) .pipe(gConcat(filename + ".css")) .pipe(gulp.dest("public/css/")); } diff --git a/package.json b/package.json index bae8d02..144062f 100644 --- a/package.json +++ b/package.json @@ -4,14 +4,15 @@ "gulp-livereload": "^3.8.1" }, "dependencies": { + "autoprefixer": "^6.3.6", "gulp": "^3.9.1", "gulp-concat": "^2.6.0", "gulp-less": "^3.0.5", "gulp-modernizr": "^1.0.0-alpha", "gulp-plumber": "^1.1.0", + "gulp-postcss": "^6.1.1", "gulp-uglify": "^1.5.3", "gulp-util": "^3.0.7", - "less-plugin-autoprefix": "^1.5.1", "less-plugin-clean-css": "^1.5.1", "less-plugin-glob": "^1.1.1" }