I have a nuxt.js project with feathers. The client and server are to different entities, you start them seperatly. The client uses nuxt.js. I want to configure production and development settings.
Currently my nuxt.config.js looks like this:
module.exports = {
head: {
title: "SITE TITLE"
},
env: {
backendUrl: 'http://localhost:3001'
}
};
What I would like is that if I start the client with 'npm run dev' development setting are used. I would like to have e.g. a different header and different backendUrl.
Question
What do I need to do to implement this?
In my project
I put this code in nuxt.config.js
and do so , You can set environment variables dynamically depends on devevelopment or production mode.
This code work for me. If you have anything better than this solution please let me know. :)