title: How to create a build for multiple environments in Nuxt?
body: <p>I am building a Nuxt application where I will have two environments <strong>staging and production</strong>, 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.</p>
  <p>I have two questions</p>
  <ol>
  <li>The command</li>
  </ol>
  <pre><code>npm run generate
  </code></pre>
  <p>always generate a production build, I checked it using</p>
  <pre class="lang-js prettyprint-override"><code>console.log(process.env.NODE_ENV)
  </code></pre>
  <p>How can I generate a new build where the env should be something like staging?</p>
  <ol start="2">
  <li>I want to create some <code>.env</code> 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).</li>
  </ol>
  <p>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?</p>