Last active
June 6, 2018 11:49
-
-
Save ahmadawais/77a825324667e0bfe076 to your computer and use it in GitHub Desktop.
Gulp: Browser Sync Task
This file contains hidden or 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
/** | |
* Browser Sync | |
* | |
* Asynchronous browser syncing of assets across multiple devices!! Watches for changes to js, image and php files | |
* Although, I think this is redundant, since we have a watch task that does this already. | |
*/ | |
gulp.task('browser-sync', function() { | |
var files = [ | |
'**/*.php', | |
'**/*.{png,jpg,gif}' | |
]; | |
browserSync.init(files, { | |
// Read here http://www.browsersync.io/docs/options/ | |
proxy: url, | |
// port: 8080, | |
// Tunnel the Browsersync server through a random Public URL | |
// tunnel: true, | |
// Attempt to use the URL "http://my-private-site.localtunnel.me" | |
// tunnel: "ppress", | |
// Inject CSS changes | |
injectChanges: true | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment