N
Nuxt2d ago
dark1zin

How to build my Nuxt 4 app in watch mode without serving the page (localhost:3000)

Hello, my question is if nuxt have some feature like building the app in watch mode but without serving it, nuxt dev builds in watch mode but serves it at localhost:3000, as far as I've looked in the docs the cli doesn't have some command like nuxt build --watch and if possible with the --prerender flag for static deployment builds. The purpose of this is that I'm building a desktop app example for electrobun, and since the page is rendered in a native webview window i just point it to the index.html in the .output, so i dont need the Nuxt app to be served at localhost:3000. PS: this is not a error or similar, i just would like to have the watch mode so i don't have to run nuxt build everytime i make a change on the frontend
2 Replies
kapa.ai
kapa.ai2d ago
Hi @dark1zin. 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 contain information about a Nuxt CLI command or configuration that allows you to build your Nuxt 4 app in watch mode without serving it (i.e., a command like nuxt build --watch or nuxt build --watch --prerender). The available sources discuss standard build and generate commands, watcher improvements, and development workflows, but none mention a watch mode for building without starting the dev server or serving the app at localhost. If you need hot-reloading or watch mode for static builds (for use cases like Electron or Electrobun), the current Nuxt CLI does not appear to support this directly according to the provided sources. You would need to manually re-run nuxt build or nuxt generate after changes, or potentially script your own file watcher to trigger builds, but this is not documented in the official or community resources above. If you are looking for more advanced or custom workflows, you may want to follow Nuxt's GitHub discussions or feature requests for updates on this capability. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2d ago
<@617089012003241994> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?