title: Easiest way to detect Production or Dev environment in NextJs?
body: <p>I want to basically detect whether the running environment is dev or production in Nextjs. Is there any straight forward way of doing this?</p>
  <pre><code>if(env == &quot;dev&quot;){
    // do something
  }
  else if (env == &quot;prod&quot;){
   // do something
  }
  </code></pre>