MBS
MBS

Reputation: 82

What is the difference between 'ssr:false' vs 'target:static' in NuxtJS?

To generate a static site using NuxtJS, it seems there are 2 options to set: ssr:false and target:static inside the NuxtJS config file (nuxt.config.js) which practically do the sme thing? Why both of them exist if they do the same thing? or is there any difference between the two options.

Upvotes: 0

Views: 934

Answers (1)

kissu
kissu

Reputation: 46602

ssr: false is used if you want to have only an SPA.
On the other hand, target: 'static' is used if you want to have SSG, rather than regular SSR (with taget: 'server').
It means that you could have a mix of:

  • ssr: true + 'static' aka SSG
  • ssr: true + 'server' aka SSR
  • ssr: false + 'static' aka SPA

Feel free to make a search on Stackoverflow to have more details.


To answer the question, static can be SSG or SPA, but the second one doesn't have all the SEO benefits etc, it's pretty much a regular Vue app (and you're loosing quite some benefits of Nuxt).

Upvotes: 2

Related Questions