next.js with custom server HMR for express server code outside of nextjs app

178 Views Asked by At

I've set us nextjs app with a custom server because I needed to integrate websocket server for graphql subscriptions and facing an issue where HMR works for the next.js code but not for the code that is served outside nextjs, e.g. graphql api endpoint served directly by express server. The default solution is using nodemon but that would reload the entire server including nextjs app which takes a few seconds. Is there a way to add webpack HMR to the code outside next app and avoid full app reloads with nodemon in dev?

0

There are 0 best solutions below