From 4971667ea1efc117155490c050cf88e02699e01f Mon Sep 17 00:00:00 2001 From: Atul Varma Date: Mon, 13 Apr 2015 08:37:55 -0400 Subject: [PATCH] attempt to always minify CSS before autoprefixing. --- gulpfile.js | 10 ++++++---- package.json | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 78ec46a8d..f1779b21a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,7 +2,6 @@ var path = require('path'); var webserver = require('gulp-webserver'); var _ = require('underscore'); var gulp = require('gulp'); -var gulpif = require('gulp-if'); var gutil = require('gulp-util'); var s3 = require('gulp-s3'); var gzip = require('gulp-gzip'); @@ -115,12 +114,15 @@ gulp.task('less', function() { paths: [path.join(__dirname, 'less')], filename: 'styles.css' })) - .pipe(gulpif(process.env.LESS_AUTOPREFIXER != 'off', autoprefixer({ + // We explicitly want to minify the CSS even in development + // environments because otherwise sourcemaps won't work. + // https://github.com/mozilla/teach.webmaker.org/issues/413 + .pipe(cssmin()) + .pipe(autoprefixer({ browsers: ['last 2 versions'], cascade: false, remove: true - }))) - .pipe(gulpif(process.env.NODE_ENV === 'production', cssmin())) + })) .pipe(rename('styles.css')) .pipe(sourcemaps.write('./')) .pipe(gulp.dest('./dist')); diff --git a/package.json b/package.json index d0f4e9f36..84ec39c2d 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "gulp": "^3.8.11", "gulp-autoprefixer": "^2.1.0", "gulp-gzip": "^1.0.0", - "gulp-if": "^1.2.5", "gulp-jsbeautify": "^0.1.1", "gulp-jscs": "^1.4.0", "gulp-jshint": "^1.9.2",