Gulp学习--less文件转化为css文件并压缩

//处理less文件(将less文件转换为css文件)
const { src,dest,task } = require('gulp');

const cssnano = require('gulp-cssnano');
const cleanCss = require('gulp-clean-css');
const minifyCss = require('gulp-minify-css');

const sass = require('gulp-sass');
const less = require('gulp-less');

const uglify = require('gulp-uglify');

const htmlMin = require('gulp-htmlmin');

const sourcemaps = require('gulp-sourcemaps');

const rename = require('gulp-rename');
const concat = require('gulp-concat');

const request = require('request');
const purifyCss = require('purify-css');

async function listenLess(){
	await src('./src/scss/*.less')
		.pipe(sourcemaps.init())
		.pipe(less())
		.pipe(cssnano({
			zindex:false
		}))
		.pipe(rename({
			suffix:'.min'
		}))
		.pipe(sourcemaps.write())
		.pipe(dest('./dist/css/'));
}

你可能感兴趣的:(gulp)