-
Notifications
You must be signed in to change notification settings - Fork 0
/
reloader.js
21 lines (19 loc) · 963 Bytes
/
reloader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//==============================================================================
// ■ Reloader (reloader.js)
//------------------------------------------------------------------------------
// Hot reloader to auto refresh browser.
//==============================================================================
//------------------------------------------------------------------------------
// ► Exports
//------------------------------------------------------------------------------
module.exports = require("connect-livereload")();
//------------------------------------------------------------------------------
// ● Server
//------------------------------------------------------------------------------
const liveReloadServer = require("livereload").createServer();
liveReloadServer.server.once("connection", () => {
setTimeout(() => {
liveReloadServer.refresh("/");
console.log("LiveReload: Browser page refreshed.");
}, 100);
});