Skip to content

Instantly share code, notes, and snippets.

@olafgleba
Last active December 8, 2015 10:49
Show Gist options
  • Save olafgleba/5221a987b9a9e3b530e7 to your computer and use it in GitHub Desktop.
Save olafgleba/5221a987b9a9e3b530e7 to your computer and use it in GitHub Desktop.
Browsersync im Gulpfile einbinden
var gulp = require('gulp');
var bs = require('browser-sync').create();
/**
* Server-Modus
* 1. Berücksichtige alle Dateien in dem hier angegebenen Ordner
*/
gulp.task('browser-sync', function() {
bs.init({
server: {
baseDir: './' /* [1] */
}
});
});
/**
* Proxy-Modus
* 1. Übergebe alle Anfragen an die laufende Serverinstanz/den vHost
*/
gulp.task('browser-sync', function() {
bs.init({
server: {
proxy: 'localhost <or> /pfad/zum/ordner/ <or> vhost-name.dev' /* [1] */
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment