Static GitHub Issues

[1509] Add HMR or automatic server restart for modified serverMiddleware scripts

prev: When the page is first opened, the response rendering is incomplete.
next: Preloading hashed, static assets with rel="preload"

Hi

The use case is that I am developing some back-end APIs for my app. To do that I use serverMiddleware and leverage the express router to implement my APIs. The config looks like this:

nuxt.config.js

    serverMiddleware: [
        '~/api/index.js',
    ]

So, each time I make changes to and save /api/index.js, or any scripts it imports, I would like the server portion of the app to reload/restart and use the latest code, just like the scripts in pages and components folders do.

However, currently that is not the case. I have to manually restart NUXT each time I want to test my changes, which is quite slow.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This feature request is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1344">#c1344</a>)</em></sub></div>