// NOTE: This is mostly just a hack to make sure that the process has time to get restarted (by eg. nodemon) before sending out a LiveReload update. Need to investigate whether there's a less hacky way to do this.
stabilityThreshold:130
}
})
.live()
.on("watch",(event,file)=>{
if(event==="change"||event==="add"){
devServer.reload(file);
}
})
.on("pending",()=>{
// This event is called when the bundle is being regenerated, ie. after watchify has detected a change in the input files
devServer.reload(fullBundlePath);
})
.on("connect",(event)=>{
letreloadServer=event.webSocketServer;
reloadServer.once("connection",(_socket)=>{
// This is to make sure the browser also reloads after the process has auto-restarted (eg. using `nodemon`)
console.log("Triggering initial page refresh for new client...");
devServer.reload("*");
reloadServer.once("connection",(_socket)=>{
// This is to make sure the browser also reloads after the process has auto-restarted (eg. using `nodemon`)
console.log("Triggering initial page refresh for new client...");