Skip to content

Instantly share code, notes, and snippets.

@DavidPeralvarez
Last active December 18, 2018 16:13
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 DavidPeralvarez/948fc5ad102118059949f940e4411d61 to your computer and use it in GitHub Desktop.
Save DavidPeralvarez/948fc5ad102118059949f940e4411d61 to your computer and use it in GitHub Desktop.
Compilar LESS
// 1- Compilar código LESS
// 2- Añadir prefijos
// 3- Minificar el archivo resultante
// 4- Renombrar el archivo
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
cleancss = require('gulp-clean-css'),
rename = require('gulp-rename'),
less = require('gulp-less');
gulp.task('estilos', function(done){
gulp.src('./src/less/app.less')
.pipe(less())
.pipe(autoprefixer({
browsers: ['last 4 versions'],
flexbox : true,
grid : true
}))
.pipe(cleancss())
.pipe(rename({
dirname : "css",
basename : "style",
suffix : ".min"
}))
.pipe(gulp.dest('./dist'));
done();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment