Last active
August 29, 2015 14:11
-
-
Save gorork/92de3a4316c7c00307a5 to your computer and use it in GitHub Desktop.
Gulpfile to compless LESS to CSS using Autoprefixer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include Gulp and all required plugins | |
var gulp = require('gulp'); | |
var less = require('gulp-less'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var minifyCSS = require('gulp-minify-css'); | |
var gutil = require('gulp-util'); | |
var sourcePath = 'src/custom'; | |
var targetPath = 'assets/css'; | |
// Create gulp task named 'less' that | |
// will take 'custom.less' file from 'sourcePath' folder, | |
// compress it, | |
// add browser specific prefixes, | |
// minify it, | |
// save result CSS file into 'targetPath' folder | |
gulp.task('less', function () { | |
return gulp.src([sourcePath + '/custom.less']) | |
.pipe(less({compress: true}).on('error', gutil.log)) | |
.pipe(autoprefixer('last 10 versions', 'ie 9')) | |
.pipe(minifyCSS({keepBreaks: false})) | |
.pipe(gulp.dest(targetPath)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment