nuxt build vs generate

Viewed 855

I'm not sure when to use what.

with nuxt build you get two directories(client & server) that means you are actually deploying node.js server(i.e. express, right?)

with nuxt generate you get .html

It seems both ways you can have good SEO which nuxt aims at. And to me, nuxt generate option seems more consize since it doesn't envolve server.

What am I missing here? Why should I use nuxt build and get server code mixed up?

1 Answers

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

nuxt build: Build your application with webpack and minify the JS & CSS (for production).
nuxt generate: Build the application and generate every route as a HTML file (used for static hosting). Josh

Related