Static GitHub Issues

[1789] Setting different value to env variable in dev, test and production environment.

prev: get the path right after reload page
next: SyntaxError: Unexpected token - in nuxt.config.js

In nuxt.config.js I have the following env variable:

  env: {
    API_URL: 'http://localhost:3000/api/'
  }

I want to set this API_URL variable different value when I'm in production, test or dev environment. How can I do this?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1604">#c1604</a>)</em></sub></div>