Skip to content

Commit

Permalink
attempt to always minify CSS before autoprefixing.
Browse files Browse the repository at this point in the history
  • Loading branch information
toolness committed Apr 13, 2015
1 parent 02255b9 commit 4971667
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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'));
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4971667

Please sign in to comment.