Skip to content

Commit

Permalink
Use csswring and autoprefixer via postcss
Browse files Browse the repository at this point in the history
csswring supports minification and sourcemaps
  • Loading branch information
swalkinshaw committed Dec 3, 2014
1 parent 9af009d commit f13d52d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/*global $:true*/
var $ = require('gulp-load-plugins')();
var _ = require('lodash');
var autoprefixer = require('autoprefixer-core');
var csswring = require('csswring');
var gulp = require('gulp');
var lazypipe = require('lazypipe');
var mainBowerFiles = require('main-bower-files');
Expand All @@ -12,6 +14,11 @@ var path = manifest.buildPaths;
var globs = manifest.globs;

var cssTasks = function(filename) {
var processors = [
autoprefixer({browsers: ['last 2 versions', 'ie 8', 'ie 9', 'android 2.3', 'android 4', 'opera 12']}),
csswring
];

return lazypipe()
.pipe($.plumber)
.pipe($.sourcemaps.init)
Expand All @@ -23,8 +30,8 @@ var cssTasks = function(filename) {
.pipe(function () {
return $.if('*.scss', $.sass());
})
.pipe($.autoprefixer, 'last 2 versions', 'ie 8', 'ie 9', 'android 2.3', 'android 4', 'opera 12')
.pipe($.concat, filename)
.pipe($.postcss, processors)
.pipe($.sourcemaps.write, '.')
.pipe(gulp.dest, path.dist + 'styles')();
};
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
},
"devDependencies": {
"asset-builder": "0.0.1",
"autoprefixer-core": "4.0.1",
"csswring": "^2.0.0",
"del": "^0.1.3",
"gulp": "^3.8.10",
"gulp-autoprefixer": "^2.0.0",
"gulp-concat": "^2.3.4",
"gulp-flatten": "0.0.4",
"gulp-if": "^1.2.5",
Expand All @@ -34,6 +35,7 @@
"gulp-livereload": "^2.1.0",
"gulp-load-plugins": "^0.7.1",
"gulp-plumber": "^0.6.3",
"gulp-postcss": "^3.0.0",
"gulp-rename": "^1.2.0",
"gulp-rev": "^2.0.1",
"gulp-sass": "^1.1.0",
Expand Down

0 comments on commit f13d52d

Please sign in to comment.