2020-07-28 03:13:15 +02:00
|
|
|
const gulp = require("gulp");
|
|
|
|
const rename = require("gulp-rename");
|
|
|
|
const csso = require("gulp-csso");
|
|
|
|
|
|
|
|
gulp.task("minify-css", minifyCSS);
|
|
|
|
gulp.task("watch-css", function() {
|
2020-07-28 03:23:27 +02:00
|
|
|
return gulp.watch(["./src/styles/index.css"], minifyCSS);
|
2020-07-28 03:13:15 +02:00
|
|
|
});
|
|
|
|
|
2020-07-28 13:56:57 +02:00
|
|
|
async function minifyCSS() {
|
|
|
|
return [
|
|
|
|
gulp.src("./src/styles/index.css")
|
2020-07-28 03:13:15 +02:00
|
|
|
.pipe(csso({restructure: false}))
|
2020-07-28 13:56:57 +02:00
|
|
|
.pipe(rename("style.min.css"))
|
|
|
|
.pipe(gulp.dest("./dist")),
|
|
|
|
gulp.src("./src/styles/index.css")
|
2020-07-28 03:23:27 +02:00
|
|
|
.pipe(rename("style.css"))
|
2020-07-28 13:56:57 +02:00
|
|
|
.pipe(gulp.dest("./dist"))
|
|
|
|
]
|
2020-05-16 23:24:51 +02:00
|
|
|
}
|