-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (34 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
35
36
37
38
39
const gulp = require("gulp");
const browserSync = require("browser-sync").create();
const css = require("gulp-css");
const uglify = require("gulp-uglify");
const cssbeautify = require('gulp-cssbeautify');
gulp.task("css", function () {
return gulp
.src("static/css/*.css")
.pipe(css())
.pipe(cssbeautify())
.pipe(gulp.dest("static/css"))
.pipe(browserSync.stream());
});
gulp.task("js", function () {
return gulp
.src("static/js/*.js")
.pipe(uglify())
.pipe(gulp.dest("static/js"))
.pipe(browserSync.stream());
});
gulp.task(
"browser-sync",
gulp.series("css", "js", function () {
browserSync.init({
proxy: "localhost:5000",
notify: false,
open: false,
});
gulp.watch("templates/**/*.html").on("change", browserSync.reload);
gulp.watch("static/css/*.css", gulp.series("css"));
gulp.watch("static/js/*.js", gulp.series("js"));
})
);
gulp.task("default", gulp.series("browser-sync"));