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