Skip to content

Instantly share code, notes, and snippets.

@tsq
Created December 7, 2015 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsq/9106932c5db0f8400971 to your computer and use it in GitHub Desktop.
Save tsq/9106932c5db0f8400971 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var less = require('gulp-less');
var sourcemaps = require('gulp-sourcemaps');
var LessPluginCleanCSS = require("less-plugin-clean-css"),
cleancss = new LessPluginCleanCSS({advanced: true});
var LessPluginAutoPrefix = require('less-plugin-autoprefix'),
autoprefix = new LessPluginAutoPrefix({browsers: ["last 2 versions"]});
gulp.task('default', function () {
gulp.src('./less/project.less')
.pipe(sourcemaps.init())
.pipe(less({
plugins: [autoprefix, cleancss]
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./css'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment