I suggest to add build.serverWatch
option that will watch specified folders and restart nuxt server middleware in dev mode.
Now to rebuild nuxt server middleware you should change nuxt.config.js
file.
Now to solve this issue I installed nodemon
and changed package.json
to
{
"scripts": {
"dev": "nodemon --watch api --exec \"nuxt\"",
},
}
So I suggest to add build.serverWatch
option in nuxt.config.js
file to watch and restart nuxt server middleware in dev mode.