Create a gist now

Instantly share code, notes, and snippets.

@ignlg /gulpfile.coffee forked from timthez/closer.js
Last active Aug 26, 2015

What would you like to do?
Close tab on browserSync disconnection, Gulp example
browserSync = require 'browser-sync'
browserSync.use
plugin: ->
hooks:
'client:js': '
/* Close tab when server dies */
(function (bs) {
bs.socket.on("disconnect", function (client) { window.close(); });
})(___browserSync___);'
# Static server
gulp.task 'browser-sync', ->
browserSync.init
server: "./dist/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment