search

Home  >  Q&A  >  body text

nuxt build and generate

I'm not sure when to use what.

Using nuxt build you will get two directories (client and server), which means you are actually deploying the node.js server (i.e. express, right?)

Use nuxtgenerate and you will get .html

It seems that both ways can achieve the good SEO that nuxt is pursuing. To me, the nuxtgenerate option seems cleaner since it doesn't involve the server.

What am I missing here? Why should I use nuxt build and obfuscate the server code?

P粉713866425P粉713866425312 days ago417

reply all(1)I'll reply

  • P粉242535777

    P粉2425357772024-03-27 00:54:38

    This is shown in the documentation: https://nuxtjs.org/docs/get-started/commands/

    nuxt build: Use webpack to build your app and minify JS and CSS (for production).
    nuxtgenerate: Build the application and generate each route as an HTML file (for static hosting). Josh

    reply
    0
  • Cancelreply