-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
56 lines (45 loc) · 1.1 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Load plugins
const browsersync = require("browser-sync").create();
const gulp = require("gulp");
// Copy third party libraries from /node_modules into /public
gulp.task('vendor', function (cb) {
// Bootstrap
gulp.src([
'./node_modules/bootstrap/dist/css/*'
])
.pipe(gulp.dest('./public/css'))
// Bootstrap
gulp.src([
'./node_modules/bootstrap/dist/js/*'
])
.pipe(gulp.dest('./public/js'))
// jQuery
gulp.src([
'./node_modules/jquery/dist/*',
'!./node_modules/jquery/dist/core.js'
])
.pipe(gulp.dest('./public/js'))
cb();
});
// BrowserSync
function browserSync(done) {
browsersync.init({
server: {
baseDir: "./"
}
});
done();
}
// BrowserSync Reload
function browserSyncReload(done) {
browsersync.reload();
done();
}
// Watch files
function watchFiles() {
gulp.watch("./css/*", browserSyncReload);
gulp.watch("./**/*.html", browserSyncReload);
}
gulp.task("default", gulp.parallel('vendor'));
// dev task
gulp.task("dev", gulp.parallel(watchFiles, browserSync));