Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

406
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!