Is there a way to determine if the Vue.js environment is in development or production?
Within my AxiosConfig
's config.js
:
AxiosConfig:{
baseURL:dev.NODE_ENV.BASE_API,
responseType: "json",
withCredentials: true,
...
You can see the BASE_API
defined here:
This is how dev.NODE_ENV
is defined:
dev.NODE_ENV = {
BASE_API: 'http://localhost:8000',
APP_ORIGIN: 'http://103.20.32.16:8000/'
}
How do I determine if the environment is in development or production?
By implementing this judgement within the AxiosConfig
config.js, I can avoid needing to change the baseURL
when running npm run build
.