Skip to content

Instantly share code, notes, and snippets.

@ahmadawais
Last active June 6, 2018 11:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmadawais/77a825324667e0bfe076 to your computer and use it in GitHub Desktop.
Save ahmadawais/77a825324667e0bfe076 to your computer and use it in GitHub Desktop.
Gulp: Browser Sync Task
/**
* 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