Last active
March 22, 2016 12:21
-
-
Save olafgleba/11aff8168b2fe6182f89 to your computer and use it in GitHub Desktop.
Browsersync mit PHP Server nutzen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var bs = require('browser-sync').create(); | |
var runSequence = require('run-sequence'); | |
var connect = require('gulp-connect-php'); | |
gulp.task('php', function() { | |
php.server({ | |
base: './app', | |
port: 8001, | |
}, function (){ | |
bs.init({ | |
proxy: 'localhost <or> /pfad/zum/ordner/ <or> vhost-name.dev' | |
}); | |
}); | |
}); | |
gulp.task('watch-all', function() { | |
gulp.watch('**/*.php').on('change', bs.reload); | |
}); | |
gulp.task('default', function() { | |
runSequence(['sass','watch-all'], 'php'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment