I was looking for a project I was working on. But I can’t seem to find it… The e online code was deleted after the revision. Sad ing. So only on the Internet to find an article to do,

Refer to the link: www.jianshu.com/p/fff7d8ba3… Add some comments and code optimization

//Gulp plugin
var gulp = require("gulp"),
  util = require("gulp-util"), //gulp packages logs or warnings. Concat = require('gulp-concat'Uglifycss = require(uglifycss = require('gulp-uglifycss'// sass = require("gulp-sass"//sass 转 CSS autoprefixer = require('gulp-autoprefixer'Minifycss = require(minifycss = require('gulp-minify-css'), // cssmin = require('gulp-clean-css'Cssver = require(gulp-make-css-url-version), cssver = require(gulp-make-css-url-version)'gulp-make-css-url-version'); // Add the version number to gulp-clean-css with rename = require('gulp-rename'), // rename the file or folder del = require('del'), // Delete files or folderslog= util.log; // Package the style file into a gmM-ng-comm.min.css? v=HJi9y08JBKGH392IHKJFH98UHO9DFDSO var sassFiles ="./scss/style.scss";
gulp.task("sass", () = > {return  gulp.src(sassFiles)
        .pipe(sass({ style: 'expanded' }))
        .pipe(autoprefixer("last 3 version"."safari 5"."ie 8"."ie 9"))
        .pipe(concat('sgm-ng-common.css'))
        .pipe(gulp.dest("./dist/css"))
        .pipe(rename('sgm-ng-common.min.css'))
        .pipe(cssver())
        .pipe(cssmin())
        .pipe(gulp.dest('./dist/css/min'));
});

gulp.task("watch", () =>  {/ /log("Watching scss files for modifications");
  gulp.watch(sassFiles, ["sass"]); }); // Delete the generated gulp.task('clean', () => {
    del(['dist']);
});

gulp.task("default"['clean'.'sass'.'themes']);
Copy the code
You can change it. Pretty clear. I hope I can help youCopy the code