Last active
December 8, 2015 10:49
-
-
Save olafgleba/5221a987b9a9e3b530e7 to your computer and use it in GitHub Desktop.
Browsersync im Gulpfile einbinden
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(); | |
/** | |
* 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