-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
41 lines (36 loc) · 1.01 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
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var connectPHP = require('gulp-connect-php');
var paths = {
php: ['config/**/*.php', 'app/**/*.php'],
html: ['resources/views/**/*.html'],
css: ['public/css/**/*.css'],
js: ['public/js/**/*.js']
};
gulp.task('php', function(){
gulp.src(paths.php)
.pipe(reload({ stream:true }));
});
gulp.task('watcher',function(){
gulp.watch(paths.css).on('change', function () {
browserSync.reload();
});
gulp.watch(paths.php).on('change', function () {
browserSync.reload();
});
gulp.watch(paths.js).on('change', function () {
browserSync.reload();
});
gulp.watch(paths.html).on('change', function () {
browserSync.reload();
});
});
gulp.task('php', function() {
connectPHP.server({ base: './', port: 8080, keepalive: true}, function (){
browserSync({
proxy: 'localhost:8080'
});
});
});
gulp.task('default', ['php', 'watcher']);