Home

Issue: 2292

process.env doesn't work in nuxt.config file?

[issue link]

Hi. I have this

sitemap: {
    path: '/sitemap.xml',
    hostname: 'http://mysite.com',
    cacheTime: 1000 * 60 * 15,
    generate: false, // Enable me when using nuxt generate
    exclude: [
      '/secret',
      '/admin/**'
    ],
    routes () {
      return axios.get(`${process.env.apiURL}/articles`)
        .then(res => res.data.map(article => '/crypto/' + article.slug))
    }
  },
  env: {
    apiURL: 'http://api.example.com'
  }

This one doesn’t work, why? ${process.env.apiURL}/articles

This question is available on Nuxt.js community (#c2005)