UNPKG

600 BJavaScriptView Raw
1const CustomEvents = require('./customevents');
2const LiveReload = (window.LiveReload = new (require('./livereload').LiveReload)(window));
3
4for (const k in window) {
5 if (k.match(/^LiveReloadPlugin/)) {
6 LiveReload.addPlugin(window[k]);
7 }
8}
9
10LiveReload.addPlugin(require('./less'));
11
12LiveReload.on('shutdown', () => delete window.LiveReload);
13LiveReload.on('connect', () => CustomEvents.fire(document, 'LiveReloadConnect'));
14LiveReload.on('disconnect', () => CustomEvents.fire(document, 'LiveReloadDisconnect'));
15
16CustomEvents.bind(document, 'LiveReloadShutDown', () => LiveReload.shutDown());