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

553
Visualizações
create build for multiple environments Nuxt

I am building a Nuxt application where i will have two environments staging and production , the local should also be considered as staging, now i need to create some commands and generate builds for production and staging , which will be deployed on two separate servers.

I have two questions

1)The command

npm run generate

always generate a production build i checked it using

console.log(process.env.NODE_ENV)

how can I generate a new build where the env should something like staging?

2)I want to create some .env files for holding some env related variables, but I am confused about how can i create multiple env files for multiple envs(staging and production).

I understand my question is a bit of research orientation, I spent days researching on the internet, but either the blogs are unrelated or confusing , i never really got what i was looking for , can someone point me into the right direction?

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

0

As told above, you can do
NODE_ENV="staging" npm run generate
while building the app, even tho this is not recommended and you should probably just use another env variable like ENV and make conditionals based on this one for your app.

If you want more details on how to use env variables, you can look at this answer.

Then, the way env variables work still applies to what I said about AWS/Heroku etc...

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