-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (28 loc) · 1.03 KB
/
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
31
32
33
34
//npm install -D gulp gulp-concat gulp-minify gulp-clean-css
const gulp = require("gulp");
const minify = require("gulp-minify");
const concat = require("gulp-concat");
const css = require("gulp-clean-css");
const STYLES = [ "src/css/form.css", "src/css/menu.css", "src/css/style.css" ];
const JS_FILES = [
"src/js/data-box.js", "src/js/date-box.js", "src/js/message-box.js", "src/js/number-box.js",
"src/js/string-box.js", "src/js/validate-box.js", "src/js/form.js", "src/js/menu.js"
];
gulp.task("pack-css", () => {
return gulp.src(STYLES)
.pipe(concat("style.min.css"))
.pipe(css())
.pipe(gulp.dest("src/css"));
});
gulp.task("pack-js", () => {
return gulp.src(JS_FILES)
.pipe(concat("multi-box.js"))
.pipe(minify({ ext: { min: ".min.js" }, ignoreFiles: [".min.js"]}))
.pipe(gulp.dest("src/js"));
});
gulp.task("watch", () => {
gulp.watch(STYLES, gulp.series("pack-css"));
gulp.watch(JS_FILES, gulp.series("pack-js"));
// Other watchers ...
});
gulp.task("default", gulp.parallel("pack-css", "pack-js", "watch"));