Nitro watch file (txt)
Hello I'm trying to watch a server file and restart Nitro only, how is possible? I tried config.watch but restarts the whole Nuxt.
(nitro.devSever.watch doesn't work neither)
2 Replies
Hi @Yaiko. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I'm sorry, but the knowledge sources do not provide a way to watch a file and restart only the Nitro server without restarting the whole Nuxt application. The
watch property in nuxt.config is designed to restart the entire Nuxt dev server when matching files change, not just Nitro — this is confirmed in both Nuxt 3 and 4 documentation:
The watch property lets you define patterns that will restart the Nuxt dev server when changed.There is no mention of a
— Nuxt 3 Watch Config, Nuxt 4 Watch Config
nitro.devServer.watch option or any Nitro-specific watcher that would only restart Nitro independently of Nuxt in the provided documentation.
If you need more granular control, such as restarting only Nitro, the knowledge sources do not contain enough information to provide a solution. You may want to follow updates in the official Nuxt and Nitro documentation or open a feature request if this is critical to your workflow.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@176572993563131904> Kapa.ai is still learning and improving, please let me know how I did by reacting below.