gulpfile.js
function transpileMinifyLESS(src) {
  return gulp.src(src)
    .pipe(sourcemaps.init())
    .pipe(lessCompiler({
      paths: [ path.join(__dirname, 'less', 'includes') ]
    }))
    .pipe(cssmin().on('error', function(err) {
      console.log(err);
    }))
    .pipe(rename({suffix: '.min'}))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest(function (file) {
      return __dirname + file.base.slice(__dirname.length);
    }));
}
function transpileMinifyLESS(src) {
  return gulp.src(src)
    .pipe(sourcemaps.init())
    .pipe(lessCompiler({
      paths: [ path.join(__dirname, 'less', 'includes') ]
    }))
    .pipe(cssmin().on('error', function(err) {
      console.log(err);
    }))
    .pipe(rename({suffix: '.min'}))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest(function (file) {
      return __dirname + file.base.slice(__dirname.length);
    }));
}
function transpileMinifyLESS ( src ) { return gulp . src ( src ) . pipe ( sourcemaps . init ( ) ) . pipe ( lessCompiler ( { paths : [ path . join ( __dirname , 'less' , 'includes' ) ] } ) ) . pipe ( cssmin ( ) . on ( 'error' , function ( err ) { console . log ( err ) ; } ) ) . pipe ( rename ( { suffix : '.min' } ) ) . pipe ( sourcemaps . write ( ) ) . pipe ( gulp . dest ( function ( file ) { return __dirname + file . base . slice ( __dirname . length ) ; } ) ) ; }
Build and minify LESS separately
Build and minify LESS separately