forked from BetterDiscord/BetterDiscord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
30 lines (25 loc) · 855 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const gulp = require("gulp");
const rename = require("gulp-rename");
const minify = require("gulp-babel-minify");
const csso = require("gulp-csso");
gulp.task("minify-js", function() {
return gulp.src("./js/main.js")
.pipe(minify({mangle: {keepClassName: true}}))
.pipe(rename("main.min.js"))
.pipe(gulp.dest("./js"));
});
gulp.task("minify-css", function() {
return gulp.src("./css/main.css")
.pipe(csso({restructure: false}))
.pipe(rename("main.min.css"))
.pipe(gulp.dest("./css"));
});
gulp.task("watch-js", function() {
return gulp.watch(["./js/main.js"], ["minify-js"]);
});
gulp.task("watch-css", function() {
return gulp.watch(["./css/main.css"], ["minify-css"]);
});
gulp.task("watch", function() {
return gulp.watch(["./js/main.js", "./css/main.css"], ["minify-js", "minify-css"]);
});