const { series, src, dest, parallel } = require('gulp');
const cleanCSS = require('gulp-clean-css');
const clean = require('gulp-clean');
const autoprefixer = require('gulp-autoprefixer');
let uglify = require('gulp-uglify-es').default;
const image = require('gulp-image');

const path =  {
    dest: 'dist/',
    src: 'resources/'
}

function cleanDir(){
    return src( path.dest +  '*', {read: false})
    .pipe(clean());
}

function css() {
    return src(path.src + 'css/*.css')
    .pipe(autoprefixer({
        cascade: false
    }))
    .pipe(cleanCSS({debug: true}, (details) => {
        console.log(`${details.name}: ${details.stats.originalSize}`);
        console.log(`${details.name}: ${details.stats.minifiedSize}`);
      }))
    .pipe(dest(path.dest + 'css/'))
}

function faviconImage() {
    return src(path.src + 'favicon/*.{png,svg}')
    .pipe(image())
    .pipe(dest(path.dest + 'favicon/'))
}

function faviconFiles() {
    return src(path.src + 'favicon/*.{ico,xml,webmanifest}')
    .pipe(dest(path.dest + 'favicon/'))
}

function img() {
    return src(path.src + 'img/*.*')
    .pipe(image())
    .pipe(dest(path.dest + 'img/'))
}

function js() {
    return src(path.src + 'js/**/*.js')
    .pipe(uglify())
    .pipe(dest(path.dest + 'js/'))
}

function pug() {
    return src(path.src + '**/*.pug')
    .pipe(dest(path.dest))
}

function copyAll() {
    return src(path.src + '**/*.*')
    .pipe(dest(path.dest))
}

exports.default = series(cleanDir,parallel(css,faviconImage,faviconFiles,img,js,pug))
exports.dev = series(cleanDir,copyAll)
exports.clean = series(cleanDir)
@@ -57,23 +57,19 @@
 %0Aconst c
-leanCSS
+sso
  = requi
@@ -82,16 +82,56 @@
 lp-c
-lean-css
+sso');%0Aconst shorthand = require('gulp-shorthand
 ');%0A
@@ -218,18 +218,20 @@
 ixer');%0A
-le
+cons
 t uglify
@@ -304,16 +304,57 @@
 image');
+%0Aconst gls = require('gulp-live-server');
 %0A%0Aconst 
@@ -626,196 +626,36 @@
 ipe(
-cleanCSS(%7Bdebug: true%7D, (details) =%3E %7B%0A        console.log(%60$%7Bdetails.name%7D: $%7Bdetails.stats.originalSize%7D%60);%0A        console.log(%60$%7Bdetails.name%7D: $%7Bdetails.stats.minifiedSize%7D%60);%0A      %7D
+shorthand())%0A    .pipe(csso(
 ))%0A 
@@ -1361,92 +1361,214 @@
 %0A%7D%0A%0A
-exports.default = series(cleanDir,parallel(css,faviconImage,faviconFiles,img,js,pug)
+function serve() %7B%0A    var server = gls('app.js', undefined, false);%0A    server.start();%0A%7D%0A%0Aconst build = parallel(css,faviconImage,faviconFiles,img,js,pug);%0A%0Aexports.default = series(cleanDir, build, serve
 )%0Aex
@@ -1602,16 +1602,23 @@
 ,copyAll
+, serve
 )%0Aexport

Add more gulp plugins