Last active
August 26, 2015 08:44
-
-
Save ignlg/b9dead5bcadc8cfa454e to your computer and use it in GitHub Desktop.
Close tab on browserSync disconnection, Gulp example
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
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