Does nuxt depend on node
If I create a nuxt project with SSR false to create a simple SPA, will it still rely on node and nitro or will it be a full client-side solution ?
2 Replies
Hi @Omnislash. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Nuxt does not strictly depend on Node.js for running the final output if you configure it as a client-side only SPA (by setting
- Development/build: Node.js and Nitro are required. - Production (SPA,
ssr: false). In this mode, Nuxt will generate static files (HTML, JS, CSS) that can be served by any static file server, and you do not need Node.js or Nitro to run the app in production.
When you set ssr: false in your nuxt.config.ts, Nuxt disables server-side rendering and produces a static single-page application. The output is similar to a classic Vue.js SPA: an index.html and JavaScript bundles. You can deploy these files to any static hosting provider, and no Node.js server is required to serve the app to users. However, you still need Node.js and Nitro during development and build time, but not for serving the built app in production as a static SPA.
Here’s the relevant configuration:
If you don't want to pre-render your routes, another way of using static hosting is to set theNuxt Deployment Docs So, to summarize:ssrproperty tofalsein thenuxt.configfile. Thenuxt generatecommand will then output an.output/public/index.htmlentrypoint and JavaScript bundles like a classic client-side Vue.js application.
- Development/build: Node.js and Nitro are required. - Production (SPA,
ssr: false): No Node.js or Nitro required; you get a full client-side solution that can be hosted on any static file server.
If you need true SSR or hybrid rendering, then Node.js (or another supported server environment) and Nitro are required in production as well. But for a pure SPA, you only need them for building, not for serving the app.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@305772639438503936> Kapa.ai is still learning and improving, please let me know how I did by reacting below.