forked from duzun/hQuery.php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (30 loc) · 853 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
/*jshint
esversion: 6,
node: true
*/
const gulp = require('gulp'),
php = require('gulp-connect-php'),
browserSync = require('browser-sync');
var reload = browserSync.reload;
// - gulp live - start a PHP web-server and browsersync for live-reload
gulp.task('php', function() {
php.server({ base: './examples', port: 8010, keepalive: true});
});
gulp.task('browser-sync', gulp.parallel('php', function() {
browserSync({
proxy: '127.0.0.1:8010',
port: 8080,
open: true,
notify: false
});
}));
gulp.task('default', gulp.parallel('browser-sync', function () {
gulp.watch(['*.php', 'examples/*.php'])
.on('change', reload)
.on('add', reload)
.on('unlink', function (path, stats) {
reload();
watcher.unwatch(path);
})
;
}));