I am working on a Vue JS project. I made a .env file in the project's root directory. I made 3 variables. Here is the content of my .env:
API_BASE_URL=http://x.x.x.x:yyyy/myproject
VUE_APP_TITLE=My App
VUE_MY_VAR=My Var
I put the logs inside the component that loads on startup in beforeMount() method like this:
beforeMount() {
console.log('base url: ' + process.env.API_BASE_URL);
console.log('base url: ' + process.env.VUE_APP_TITLE);
console.log('base url: ' + process.env.VUE_MY_VAR);
}
When I run dev server using vue-cli-service serve I see the following console output:
base url: undefined
base url: My App
base url: undefined
My question is: why is the value of API_BASE_URL and VUE_MY_VAR undefined