BetterDiscordApp-rauenzi/gulpfile.js

33 lines
873 B
JavaScript
Raw Normal View History

2018-10-23 03:40:34 +02:00
const gulp = require("gulp");
const rename = require("gulp-rename");
const minify = require("gulp-babel-minify");
const csso = require("gulp-csso");
2019-04-20 21:56:43 +02:00
gulp.task("minify-js", minifyJS);
gulp.task("minify-css", minifyCSS);
2018-10-23 03:40:34 +02:00
gulp.task("watch-js", function() {
2019-04-20 21:56:43 +02:00
return gulp.watch(["./js/main.js"], minifyJS);
2018-10-23 03:40:34 +02:00
});
gulp.task("watch-css", function() {
2019-04-20 21:56:43 +02:00
return gulp.watch(["./css/main.css"], minifyCSS);
2018-10-23 03:40:34 +02:00
});
gulp.task("watch", function() {
2019-04-20 21:56:43 +02:00
return gulp.watch(["./js/main.js", "./css/main.css"], gulp.series(minifyJS, minifyCSS));
});
function minifyJS() {
return gulp.src("./js/main.js")
.pipe(minify({mangle: {keepClassName: true}}))
.pipe(rename("main.min.js"))
.pipe(gulp.dest("./js"));
}
function minifyCSS() {
return gulp.src("./css/main.css")
.pipe(csso({restructure: false}))
.pipe(rename("main.min.css"))
.pipe(gulp.dest("./css"));
}