You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does anyone know how to enable hot reloading with listeners for Vite?
My first attempt was to set the middleware to be mutable
let listenerMiddlewareToReplace = listenerMiddleware.middleware;
Then I could:
if(import.meta.hot){import.meta.hot.accept("* path to listeners *",(incoming)=>{listenerMiddlewareToReplace=// incoming.correct item. or just require});}
However I've a couple of problems, one I can't seem to get that accept to work, even when using direct paths, and secondly I'm not sure if they way I've described above of just change the middleware reference is enough?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
Does anyone know how to enable hot reloading with listeners for Vite?
My first attempt was to set the middleware to be mutable
let listenerMiddlewareToReplace = listenerMiddleware.middleware;
Then I could:
However I've a couple of problems, one I can't seem to get that accept to work, even when using direct paths, and secondly I'm not sure if they way I've described above of just change the middleware reference is enough?
Beta Was this translation helpful? Give feedback.
All reactions