Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Lazerproof/de60fd93d8c21bf1b2a1 to your computer and use it in GitHub Desktop.
Save Lazerproof/de60fd93d8c21bf1b2a1 to your computer and use it in GitHub Desktop.
Browsersync mit PHP Server nutzen
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