Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

401
Visualizações
How to build Nuxt with specific content

I build a multi-site where one frontend can request information from the backend based on the domain. Code and style is always the same and some routes too, but content must be dynamic per domain.

Everything works fine otherwise, but I don't know how to run Nuxt so that CSS / Tailwind / JavaScript is in production mode and SSR + CSR will handle whatever comes from the backend. Normal pages can't be static pages and I don't know all routes needed so those need to be generated when the backend sends data.

I tried to follow Nuxt server tutorials, but no luck yet. I think I have to run Express or module nuxt-start, but those gave FATAL No build files found in .nuxt/dist/server.

How can one run Nuxt which can handle multiple domains and different content? npm run dev works as I want for production working, but needs to be more optimized and faster. What kind of configuration I need?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

To build for production, you need to either do:

  • yarn generate (target: static)
  • or yarn build (target: server, aka the default value)
  • then you should yarn start (on the production server).

As for having custom content, this one should probably be dependent of some env variables to decide where to fetch the content from, and then using nuxtServerInit to populate your Vuex store: https://nuxtjs.org/docs/2.x/concepts/nuxt-lifecycle

Of course, you could also do it elsewhere, like in serverMiddleware or at build time if you use Docker.

As for the routes, you can keep them dynamic and populate them with the related data.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda