forked from CIAT-DAPA/pakistan_web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
24 lines (21 loc) · 683 Bytes
/
gulpfile.js
File metadata and controls
24 lines (21 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const gulp = require('gulp')
const browserSync = require('browser-sync').create()
const root = './public'
const PORT = process.env.PORT || 3000
// browsersync local static server
const server = function () {
browserSync.init({
server: root,
port: PORT
})
}
// Files to watch for changes then reload browser
const watch = function () {
gulp.watch(`${root}/*.html`).on('change', browserSync.reload)
gulp.watch(`${root}/*.css`).on('change', browserSync.reload)
gulp.watch(`${root}/*.js`).on('change', browserSync.reload)
}
// Gulp tasks
gulp.task('browserSync', server)
gulp.task('watch', watch)
gulp.task('dev', gulp.series(gulp.parallel('browserSync', 'watch')))