-
Notifications
You must be signed in to change notification settings - Fork 147
/
gulpfile.js
executable file
·38 lines (31 loc) · 1013 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
31
32
33
34
35
36
37
38
var gulp = require("gulp"),
browserSync = require("browser-sync").create(),
source = "./builds/angular/",
dest = "./builds/angular/";
function html() {
return gulp.src(dest + "**/*.html");
}
function js() {
return gulp.src(dest + "**/*.js");
}
function styles() {
return gulp.src(dest + "**/*.css");
}
function watch() {
gulp.watch(source + "js/**/*.js", js).on("change", browserSync.reload);
gulp.watch(source + "css/**/*.css", styles).on("change", browserSync.reload);
gulp.watch(source + "index.html", html).on("change", browserSync.reload);
}
function server() {
browserSync.init({
notify: false,
server: {
baseDir: source
}
});
}
gulp.watch(source + "css/**/*.css", styles).on("change", browserSync.reload);
gulp.watch(source + "index.html", html).on("change", browserSync.reload);
gulp.watch(source + "index.html", js).on("change", browserSync.reload);
var build = gulp.series(gulp.parallel(js, styles, html), server, watch);
gulp.task("default", build)